How to identify build_id/name of a job generated by Jenkins Remote Trigger
How does the application get back the BUILD_ID or BUILD_NUMBER that their HTTP Post has caused when submitting the build request by performing an HTTP Post to the Jenkins CI Job using .../buildWithParameters?token=TOKEN
to kick off a build?
For example, if I have 6 applications running that each kick off the same Jenkins CI job, each build wo开发者_如何转开发uld get a different build_id, but how does each application know which particular build_id corresponds to their trigger request?
Once they trigger a build, get the build_id and store it
.../api/xml?xpath=//lastBuild/number/text()
Will get you the build number of the currently running job. Assuming your job goes faster then a few seconds, using the lastBuild/number/text() will get you the build number that you can then use later to retrieve whatever you want.
精彩评论