Skip to content

Instantly share code, notes, and snippets.

@cmoetzing
cmoetzing / bamboo_delete_disabled_branches_of_project.sh
Last active November 2, 2020 13:39
Script to delete all disabled branchs of all plans of a project.
#!/bin/bash
# Based on a script by Sylvain Guillopé <sguillope@lixar.com>
# https://gist.github.com/sguillope/001c1f5574be3be3a595#file-bamboo_delete_disabled_branches-sh
LC_COLLATE=C ; export LC_COLLATE
LANG=C ; export LANG
umask 022
function die {
[ -z "$1" ] || echo 1>&2 "[!] $1"
@cmoetzing
cmoetzing / bamboo_delete_disabled_branches.sh
Last active February 3, 2021 09:10 — forked from sguillope/bamboo_delete_disabled_branches.sh
Script to delete all disabled branches of a Bamboo build plan.
#!/bin/bash -u
# Deletes all disabled branches of a Bamboo build plan
# -----------------------------------------------------------------------------
# Syntax:
# $0 {planKey}
# -----------------------------------------------------------------------------
# Purpose: Bamboo does not automatically delete plan branches when the
# corresponding branch in the repository gets deleted. Because Bamboo fails
# to pull from it, it disables the branch but keep it around forever.
# This script goes through all branches of a build plan and delete the ones