Allow reloading configuration contents via POST (not from disk)
See original GitHub issueFeature Request
I’m in the process of migrating our Jenkins installation to use Configuration as Code. We have some prior work in the form of a repo that uses Groovy to specify the jobs configuration (kinda like job DSL, but home-grown).
When this repo is changed, a build is started on Jenkins that reloads the jobs.
I would like to add the YAML CasC to the same repo and reload it during the same build. I found that it’s possible to trigger a reload via a number of different ways (Jenkins CLI, API request). However, all of those ways assume a fixed location for the configuration.
Normally, our build jobs are checked out into a random workspace path which is cleaned up after the build is finished. We can work around this, but it would be nice to have a better solution. Hence this feature request. There is some prior discussion here: https://github.com/jenkinsci/configuration-as-code-plugin/issues/76
A POST endpoint that can directly load configuration would allow a natural webhook-build-update workflow to connect CasC to git. Additionaly, it would also be useful for administrators looking to change individual settings via curl.
Proposal
Add a new POST endpoint such that
POST JENKINS_URL/configuration-as-code/configure
takes YAML configuration that is applied the same way as if it was loaded from a file.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top GitHub Comments
So instead of all that complexity, how about the proposal in this issue? 😃
Ya if we want to support the git client which is also another complexity. However they have very different APIs and have very different ways of reading the raw file.