I decided to create a simple PHP console script that can be run (or added as a git-hook) to maintain synchronization between the branch you are working on and the branch Jenkins is building. Whilst developing this script, it dawned on me that many other automated use-cases could be achieved with the ability to easily update a projects configuration file. [...] Jenkins fortunately provides us with a RESTful interface to manage typical tasks and activities. Included in this is the ability to read the XML configuration file for a specified project.
The tutorial includes examples of requests you can make to the API to do things like:
- Reading the Projects Configuration
- Writing to the Projects Configuration
- Sending a Project Build Request
The post ends with the full script, a procedural process that executes each of the above steps in order (with an interesting use of the "goto" functionality).