hudson-api

Determine if given job is currently running using Hudson/Jenkins API

好久不见. 提交于 2019-11-30 04:53:37
Is there an API to determine whether a given job is currently running or not? Ideally, I'd also like to be able to determine its estimated % complete and get the details of the SVN revision number and commit comment too! EDIT: I found the answer. http://host/job/project/lastBuild/api/ has almost all of what I need in it somewhere! If you kick off a manual build, it won't tell you the SCM changesets, but that makes sense. It does still tell you the latest SCM revision though, so that's good. All in all, good enough for my purposes right now. As gareth_bowles and Sagar said, using the Jenkins

How to access Hudson job1 artifacts from another job2?

℡╲_俬逩灬. 提交于 2019-11-30 03:45:03
问题 We have a production job and a nightly job for a project in Hudson. The production job needs to pull off some artifacts from a specific nightly build # (which is provided as parameter). Can anyone help us with a hint on how to achieve this? 回答1: The Copy Artifact plugin seems to be capable of doing this. Another approach could be to fetch the artifact via http://server/jobs/job1/[build #]/artifacts/ 回答2: You can use "Build Environment" configuration tools in the job's configuration page. Tick

Determine if given job is currently running using Hudson/Jenkins API

流过昼夜 提交于 2019-11-29 02:20:13
问题 Is there an API to determine whether a given job is currently running or not? Ideally, I'd also like to be able to determine its estimated % complete and get the details of the SVN revision number and commit comment too! EDIT: I found the answer. http://host/job/project/lastBuild/api/ has almost all of what I need in it somewhere! If you kick off a manual build, it won't tell you the SCM changesets, but that makes sense. It does still tell you the latest SCM revision though, so that's good.

HUDSON: How to stop hudson job from command line?

孤街醉人 提交于 2019-11-29 02:12:09
I need to forcefully stop a Hudson build running in remote server. Is there a command/API to do that? for ex: to trigger a new build we can do :- HUDSON_URL/job/JOBNAME/build looking for similar API to stop the build. You should be able to make a http request to http://HUDSON_URL/job/JOBNAME/BUILDNUMBER/stop and you can do a xpath request to get the build number http://HUDSON_URL/job/JOBNAME/api/xml?xpath=//lastBuild/number/text() There may be a way to put in latestBuild or lastBuild instead of BUILDNUMBER, but if not, you can just use 2 http gets. From the above answer (upvoted), @girishs'