I would like to be able to update job config files remotely using the Jenkins REST API and cURL.
- CloudBees Jenkins Enterprise
- Remote Access API
Here is an example that I used to test this locally:
# Get current config curl --user $USER:$API_TOKEN -X GET http://localhost:8080/job/test/config.xml -o mylocalconfig.xml # Post updated config curl --user $USER:$API_TOKEN -X POST http://localhost:8080/job/test/config.xml -H 'Content-Type: application/xml' --data-binary "@mymodifiedlocalconfig.xml"
Where you will have to replace:
$USER:$API_TOKENwith your username and an API token
localhost:8080with your Jenkins URL
testwith your job name
See Remote Access API for more.