mattdoe
mattdoe

Reputation: 33

Automatically run a Jenkins build after a configuration change

Our department has a Jenkins server set up to poll SCM periodically and run a build if anything has changed. This works great most of the time, but we recently ran into an issue after making configuration updates. The config changes exposed some underlying issues, but no build was run until people delivered code into individual projects. This made it look like those individuals' changes had broken the build, when in fact they had not.

I'd like to configure Jenkins so that it will automatically trigger a build of a project after changes have been made to that project's Jenkins configuration. This will help us catch any future errors like the one we already encountered and will give us faster insight in case a configuration change is actually bad. Is there a way to do this?

Upvotes: 2

Views: 1627

Answers (1)

Slav
Slav

Reputation: 27485

You may consider SCM Sync Plugin. It stores Jenkins configuration into SCM.
You can then poll the same SCM location (in addition to your regular SCM location), and if changes found (i.e. configuration is updated), then run the build.

Note that it doesn't work with version 2.0 of the SCM plugin

Along the same principle, you can use Jenkins FS Trigger plugin to detect file changes (i.e. job's config.xml) directly on the filesystem, to trigger a build.

Upvotes: 2

Related Questions