Added script to revert a release

This commit is contained in:
butomo1989 2018-05-29 00:09:28 +02:00
parent efccb144a4
commit 424b6bb2ec

29
revert.sh Normal file
View file

@ -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