Reputation: 1550
I am using Jenkins with tomcat. I use jenkins cli from java class to create job and to build. I want to check, is any build is progress. Is there anyway to do that ?
Thanks.
Upvotes: 1
Views: 390
Reputation: 16615
The following XPath expression will give you the total number of busy executors on the master and all slaves, if it's > 0, you have a job running:
http://[jenkins_server]/computer/api/xml?xpath=/computerSet/busyExecutors/text()
You can connect to your server from Java via HTTP and query it.
Upvotes: 2