The templates and definitions in this repository are used to create the Jenkins jobs for the EPICS V4 Continuous Integration system instance hosted on CloudBees.
The tool used to create the XML job definitions is called Jenkins Job Builder.
It takes simple descriptions of Jenkins jobs in YAML or JSON format and uses them to create the XML files that configure Jenkins.
These XML job descriptions are uploaded to Jenkins using its web service API (via https).
-
Install Jenkins Job Builder (JJB).
$ sudo pip install jenkins-job-builder
-
Clone this repository.
-
Add your CloudBees credentials to the JJB configuration file
cloudbees.ini
. It should be possible to use an API token, but that seems not to be working on the CloudBees Jenkins instance.
To check the generated XML, use JJB's test
command:
$ jenkins-jobs --conf ./cloudbees.ini test cloudbees
You can add job names as additional arguments to limit the XML generation to the specified jobs. Wildcards in job names are supported.
You can add -o <outputdir>
to create all jobs as separate XML files.
To update the jobs on CloudBees, use JJB's update
command:
$ jenkins-jobs --conf ./cloudbees.ini update cloudbees
Job names as additional arguments will update only the specified jobs. Wildcards in job names are supported.
JJB offers commands to delete jobs (even all jobs) on Jenkins.
Do not use these commands.
They will possibly affect all jobs on the Jenkins instance, including those not generated by JJB and those of other projects.