Delete all disabled branches of a Bamboo build plan

Recently I found myself doing some Bamboo maintenance. Namely, I had to delete all disabled branches of build plan related to already deleted feature branches that Bamboo failed to automatically remove. At first, I tried this shell script, but it didn’t work for me with Bamboo 5.6.2 and I ended writing my own version. I’m posting it here hoping it will be useful for others too

Usage is very simple

groovy bamboo_delete_disabled_branches.groovy \
      --bamboo-url <BAMBOO_URL, i.e. http://mycompany/bamboo> \
      --plan-key <PLAN_KEY> \
      --user <USER> --password <PASSWORD>

You can also perform a simulation without actually deleting anything with „–dry-run” option.

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s