docker-android/revert.sh

30 lines
567 B
Bash
Raw Normal View History

2018-05-28 23:09:28 +01:00
#!/bin/bash
2019-01-30 13:58:31 +00:00
IMAGE_NAME="budtmo/docker-android"
2018-05-28 23:09:28 +01:00
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