Muthu
Muthu

Reputation: 1550

How to find atleast one build is in progress in Jenkins?

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

Answers (1)

malenkiy_scot
malenkiy_scot

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

Related Questions