Created
June 9, 2015 11:15
-
-
Save tuxfight3r/58bd9b69134791c64255 to your computer and use it in GitHub Desktop.
Jenkins REST API Automation via curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the current configuration and save it locally | |
curl -X GET http://user:[email protected]/job/myjobname/config.xml -o mylocalconfig.xml | |
#Update the configuration via posting a local configuration file | |
curl -X POST http://user:[email protected]/job/myjobname/config.xml --data-binary "@mymodifiedlocalconfig.xml" | |
#Creating a new job via posting a local configuration file | |
curl -X POST "http://user:[email protected]/createItem?name=newjobname" --data-binary "@newconfig.xml" -H "Content-Type: text/xml" | |
Note: Use --data-binary to post the data, else the line-endings won’t be transfered correctly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment