Cancel queued builds and aborting executing builds using Groovy for Jenkins

前端 未结 9 2161
礼貌的吻别
礼貌的吻别 2020-12-01 00:28

For Jenkins using a Groovy System Script, is there a way to easily search the build queue and list of executing builds for some criteria (specifically a parameter that match

9条回答
  •  星月不相逢
    2020-12-01 01:29

    Use the jenkins groovy postbuild plugin:
    I think this would be the groovy script:

    import hudson.model.*  
    def q = jenkins.model.Jenkins.getInstance().getQueue()   
    def items = q.getItems()  
    for (i=0;i

提交回复
热议问题