4

This link Is there a way to keep Hudson / Jenkins configuration files in source control? shows how to save Hudson configuration changes to an SCM (i.e. a "backup with history")

My question is: can the Hudson configuration be pulled from an SCM. In other words, to change a job configuration, you add a changeset to the SCM repository first. Hudson, at the start of a build, pulls the configuration from the SCM and runs as usual.

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

Why would I want this?

  • I want the SCM to be where a configuration change is begun. Why? So
    the changesets in the SCM reflect when the configuration change was
    done in the flow of changesets for the project, i.e. it imposes a
    chronological ordering to the project changes.
  • I don't want to use the security feature (i.e. no need for a login, etc)

I searched and could only find plugins for backing up or saving the configuration, but none that "pulled" the .xml files.

Thanks, John

Community
  • 1
  • 1
JohnA
  • 41
  • 1

1 Answers1

1

I haven't tried it myself, but you might be able to do this with a custom build that does the following on a schedule:

  1. Sync all of the job configuration files from your SCM into the Hudson jobs directory
  2. Do an HTTP GET to [Your Hudson URL]/reload - this is the equivalent of clicking the "Reload Configuration from Disk" link on the "Manage Hudson" page.

I don't think you could have each job update its own configuration from SCM every time it runs, because the configuration will have already been loaded by the time the job polls the SCM for changes.

gareth_bowles
  • 20,760
  • 5
  • 52
  • 82
  • Gareth, Thanks for the reply. I'll give it a try. It also implies it could be done the other way: add a trigger script on the SCM repository to do the reload whenever a changeset is submitted. Not sure if Mercurial has that on the hgweb side of things. – JohnA Aug 17 '11 at 00:59