From 424b6bb2ece4d61a7c13120436a087027007e7ff Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Tue, 29 May 2018 00:09:28 +0200 Subject: [PATCH] Added script to revert a release --- revert.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 revert.sh diff --git a/revert.sh b/revert.sh new file mode 100644 index 0000000..98b629c --- /dev/null +++ b/revert.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +IMAGE_NAME="butomo1989/docker-android" + +if [ -z "$1" ]; then + read -p "Type : " TYPE +else + TYPE=$1 +fi + +if [ -z "$2" ]; then + read -p "Version : " VERSION +else + VERSION=$2 +fi + +declare -a versions=("7.1.1" "7.0" "6.0" "5.1.1" "5.0.1") + +## now loop through the above array +for v in "${versions[@]}" +do + IMAGE="$IMAGE_NAME-$TYPE-$v" + IMAGE_OLD="$IMAGE:$VERSION" + IMAGE_LATEST="$IMAGE:latest" + echo "Revert image \"$IMAGE_LATEST\" to version \"$IMAGE_OLD\"" + docker pull $IMAGE_OLD + docker tag $IMAGE_OLD $IMAGE_LATEST + docker push $IMAGE_LATEST +done