Simplest Enterprise Continuous Integration Solutions

Saturday, January 17, 2015

Jenkins REST API: Practice within Continuous Integration

Jenkins REST API launch a parameterized build


/usr/bin/curl -X POST http://<jenkins-user>:<jenkins-token>@<jenkins-server-to-build-job>/build --form 'json={"parameter":[{"name":"RELEASE_VERSION","value":"1.0.0"},{"name":"DEVELOPMENT_VERSION","value":"1.0.0-SNAPSHOT"},{"name":"JIRA_ISSUE","value":"<jira-key>"}]}'

Monitor Jenkins build status


http://<jenkins-server-to-build-job>/api/xml
http://<jenkins-server-to-build-job>/lastBuild/api/xml  (Note: only valid while nextbuildnumber > 1)