Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to cancel all builds from queue?

Tags:

teamcity

I can't find a UI way in TeamCity to clear all queued builds in bulk.

One by one is possible, but sometimes triggers/dependencies hit the fan and you end-up with tens of unwanted builds.

REST API is another way, also requires individually cancelling each build.

I expected to have "Remove All" or "Drop Queue" button

like image 278
LironZ Avatar asked Oct 26 '25 13:10

LironZ


2 Answers

There is now an official way to do this :

  1. Go to queue
  2. Pause build queue
  3. Select -> All X builds
  4. Click on "Remove from queue..."

EDIT (thanks to @taz) Note that this button will only show up if none of the selected builds are running. Either stop all running builds or deselect the running ones first.

like image 75
bmtheo Avatar answered Oct 29 '25 13:10

bmtheo


Updated version:

const count = $x("//button[contains(@title,'Cancel build...')]").length;
const xxx = $x;
for( i=0 ; i<count ; i++ ) {
    setTimeout(() => {
        const r = xxx("//button[contains(@title,'Cancel build...')]")[0];
        r.click();
        setTimeout(() => {
            const rem = xxx("//input[@id='submitRemoveQueuedBuild']")[0];
            console.log('Button', rem);
            rem.click();
        }, 1000);

    }, i * 2000);
}
like image 44
juliusspencer Avatar answered Oct 29 '25 14:10

juliusspencer