Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 2.82 KB

jenkins_job_maintenance.adoc

File metadata and controls

58 lines (36 loc) · 2.82 KB

Jenkins Job Maintenance

This page documents how to pull copies of Jenkins job config.xml files to your local machine, make changes, and push them back to Jenkins.

The tool used for this is a maven mojo called hudson-job-sync

Setting up hudson-job-sync

As documented here, there are a number of steps to using this tool.

  1. Clone the sources

  2. Build the maven mojo

  3. Configure your JDK’s keystore

  4. Configure usage for your Jenkins machine. For example, create a pom file like this one in which you set defaults for:

    1. viewFilter, regexFilter

    2. hudsonURL, username, password

Using hudson-job-sync

Once you have the above steps completed, you can run the mojo as a push (from local to remote server) or pull (from remote server to local) operation.

Here are a couple of shell scripts to make that easier. You’ll have to adjust them to match your own paths on disk where you have your config.xml files checked out.

Some examples:

# to pull jobs matching /.*servertools.*/
. ~/bin/hudpull-eclipseJIPP.sh -DhudsonURL=https://ci.eclipse.org/webtools/ \
-DviewFilter=view/webtools_R3_10/ -DregexFilter=servertools

# make changes locally, then push back to server
. ~/bin/hudpush-eclipseJIPP.sh -DhudsonURL=https://ci.eclipse.org/webtools/ \
-DviewFilter=view/webtools_R3_10/ -DregexFilter=servertools

# or, for a different view filter:
. ~/bin/hudpull-eclipseJIPP.sh -DhudsonURL=https://ci.eclipse.org/webtools/ \
-DviewFilter=view/gerrit/ -DregexFilter=jsdt

# make changes locally, then push back to server:
. ~/bin/hudpush-eclipseJIPP.sh -DhudsonURL=https://ci.eclipse.org/webtools/ \
-DviewFilter=view/gerrit/ -DregexFilter=jsdt

Note that using no viewFilter will default to whatever value is set in your pom.xml.

If you want to match on all configs in the view, use .*

Commit changes

After confirming your changes are pushed to the remote server, and didn’t break anything, you can commit the same changes to your local config.xml cache for storage/versioning.