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.

API/Method to stop a ONGOING build #43

navalta3030 ·

Hi, I'm trying to use groovy code and inside there on some part I'm trying to find a way to stop the ONGOING build through method(preferred) or API. I tried looking inside the build object and also the other ones, also tried going inside the source code but no luck.

How can I stop an ongoing build through a method/api?

  • replies 3
  • views 2685
  • stars 0
robinshen ADMIN ·

Please use below statement to stop a build from within Groovy:

throw new com.pmease.quickbuild.QuickbuildException("reason for stop");
navalta3030 ·

Another thing... What if We initiated a separate thread that watches the main build and if it detects something wrong it will stop the main build. I tried that one but doesn't seem to be going in. Any comment?

robinshen ADMIN ·

In that case, your watching thread should either interrupt the main thread (and hope the main thread reacts to thread interruption) or change value of a shared variable, and main build thread should poll value of the variable to see if it has been told to stop.