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.