Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Cancel all builds in queue #4394

nini10 ·

Hi,

I have a request that when current build fails, configuration needs to cancel all existing builds in the queue.

The code probably need to set in "Post-Build Script".

Can someone please provide me with an example code?

Thanks!

  • replies 2
  • views 1513
  • stars 0
robinshen ADMIN ·
groovy:
if (build.isFailed()) {
  for (eachRequest in system.buildEngine.getBuildRequests(configuration.id)) {
    system.buildEngine.cancelRequest(eachRequest.id)
  }
}
halverns20 ·

Hello, enter this code, what your friend gave above, I also entered it once and it was good and the problem disappeared forever