How to get Hudson configuration from SCM?

This link Is there a way to save the Hudson / Jenkins configuration files in source control? shows how to save Hudson configuration changes to SCM (i.e. "back up using history")

My question is: is it possible to pull out the Hudson configuration from SCM. In other words, to change the configuration of a job, first add the changeset to the SCM repository. Hudson, at the beginning of the build, pulls the configuration out of SCM and works as usual.

Of course, it would also be ideal for the entire job configuration screen to be read-only (or as little as possible).

Why do I need it?

  • I want SCM to be where the configuration change started. What for? So
    changes in SCM reflect when a configuration change was made in the stream of change sets for the project, i.e. imposes a chronological order of making changes to the project.
  • I do not want to use the security function (i.e. there is no need for a login, etc.)

I searched and could only find plugins to backup or save the configuration, but none of them “pulled out” the XML files.

Thanks, John

+4
source share
1 answer

I have not tried it myself, but you can do it with a custom build that does the following on schedule:

  • Synchronize all job configuration files from your SCM to the Hudson job directory
  • Perform an HTTP GET [your Hudson’s URL] / reload - this is the equivalent of clicking the "Update configuration from disk" link on the "Hudson Management" page.

I don’t think that every job can update its own configuration from SCM every time it starts, because the configuration will already be loaded by the time the job polls SCM for changes.

+1
source

All Articles