简体   繁体   中英

Create Jenkins jobs from a Git directory with job DSL files

I have a folder in a GitHub project which contains a bunch of groovy files, each containing the DSL for one job eg: jenkins-as-code/tree/master/jobs contains samplejob1.groovy, samplejob2.groovy, etc.

How would I configure a seed job in Jenkins that would get this list of groovy files from Git and create a job for each one of them.

Solution

In the seed job configuration screen:

  1. Clone the git project into workspace in the Source Code Management section.
  2. Add a Process Job DSLs build step, select the Look on Filesystem option and enter jobs/ .groovy* in the DSL Scripts field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM