#!/usr/bin/env bash set -euo pipefail if [[ "$#" -eq 0 ]]; then { echo "Usage: ${0} [multi-dev 2]... etc." echo echo "For example:" echo " ${0} mr-819 mr-815 mr-814" echo } >&2 exit 1 fi if [[ ! -d ".git" ]]; then { echo "This must be run inside a checked-out copy of the pantheon-d8-prototype site." echo } >&2 exit 2 fi echo "## Refreshing Tags" git fetch origin --tags echo if ! git rev-parse -q --verify "refs/tags/pantheon_live_1" >/dev/null; then { echo "This must be run inside a checked-out copy of the pantheon-d8-prototype site." echo } >&2 exit 2 fi site_id="e450db97-5017-4aef-b21b-26f9f64da921" multidevs=("$@") for multidev in "${multidevs[@]}"; do echo "## Removing '${site_id}.${multidev}'" echo "### Deleting Multi-Dev" ( set -x terminus multidev:delete "${site_id}.${multidev}" --delete-branch --yes ) echo "" echo "### Cleaning Up Tag" ( set -x git push origin ":pantheon_${multidev}_1" git tag -d "pantheon_${multidev}_1" ) echo "" done # Or, clean-up all tags: # git tag | grep pantheon_mr | while read tag; do # git push origin ":${tag}" # git tag -d "${tag}" # done