Jenkins command to get number of builds in queue

前端 未结 5 1088
傲寒
傲寒 2021-01-04 00:54

I am trying to get the number of builds in the Jenkins Build Queue.

May I know the Jenkins command to get the number of builds running in the queue ?

5条回答
  •  渐次进展
    2021-01-04 01:30

    This single bash variable definition using the awesome "jq" utility was all I needed to get the queue length:

      QUEUE_SIZE=$(curl -s -k http:///queue/api/json | jq '.items | length')
    

    Hope this helps.

提交回复
热议问题