#!/bin/bash docker-compose down git checkout current TAG=$(git describe --tags) git fetch --tags # select from last 5 tags if [ latestTag="" ] ; then PS3="Enter number of version: " select version in $(git tag -l | tail -5) do latestTag=$version; echo "Upgrading to $version ..." break; done fi # or use latest # latestTag=$(git tag -l | tail -1`) # update upstream git branch -D upstream git pull git checkout $latestTag git switch -c upstream # fix permission and rebuild chmod +x docker-entrypoint.sh chmod +x ./scripts/auth-su.sh ./scripts/auth-su.sh user docker build --tag umap:$latestTag . # fix permission chmod +x ./scripts/auth-su.sh ./scripts/auth-su.sh # restart sed -i 's/umap:'${TAG}'/umap:'${latestTag}'/g' docker-compose.yml; docker-compose up -d; # resync current git branch -D current git branch current