From 8f7d4792d95fa6b2eb623256fc3270c10d9c57bd Mon Sep 17 00:00:00 2001 From: Ramiro Berrelleza Date: Tue, 16 Nov 2021 01:14:27 -0800 Subject: [PATCH] rollback actions (#1940) --- rollback_actions.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 rollback_actions.sh diff --git a/rollback_actions.sh b/rollback_actions.sh new file mode 100755 index 000000000000..1749d3182afd --- /dev/null +++ b/rollback_actions.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -e + +VERSION=$1 + +if [ -z "$VERSION" ]; then + echo "missing version" + exit 1 +fi + +actionsRepos=(delete-namespace + build + destroy-preview + deploy-preview + deploy-stack + namespace + pipeline + push + create-namespace + destroy-pipeline + login + destroy-stack + apply + context + ) + +for repo in "${actionsRepos[@]}"; do + echo "$repo" + rm -rf "$repo" + git clone git@github.com:okteto/"$repo".git + pushd "$repo" + git checkout "$VERSION" + git tag -d latest + git push --delete origin latest + ghr -token "$GITHUB_TOKEN" -delete "latest" + popd + rm -rf "$repo" +done