1. Install groovy plugin

2. Add a step of groovy. (normal & systerm)

3. Execute groovy script

import jenkins.model.*

def q = Jenkins.instance.queue

q.items.findAll{ it.task.name.startsWith('ttt') }.each{ q.cancel(it.task) }

Above script is cancel all pending build in queue.

 

 

Additional info:

install groovy :

GVM (the GroovyenVironment Manager)
This tool makesinstalling Groovy on any Bash platform (Mac OSX, Linux, Cygwin, Solaris orFreeBSD) very easy.
Simply open a newterminal and enter:
$ curl -s get.gvmtool.net | bash
Follow theinstructions on-screen to complete installation.
Open a newterminal or type the command:
$ source "$HOME/.gvm/bin/gvm-init.sh"
Then install thelatest stable Groovy:
$ gvm install groovy
After installationis complete and you've made it your default version, test it with:
$ groovy -version
That's all thereis to it!

相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-03-02
  • 2021-09-22
  • 2021-09-01
猜你喜欢
  • 2021-10-23
  • 2022-12-23
  • 2021-08-06
  • 2021-10-11
  • 2022-12-23
  • 2022-03-08
  • 2022-01-30
相关资源
相似解决方案