diff --git a/build_docker_multi_platforn.sh b/build_docker_multi_platform.sh similarity index 67% rename from build_docker_multi_platforn.sh rename to build_docker_multi_platform.sh index b16cbd8..bd272d6 100644 --- a/build_docker_multi_platforn.sh +++ b/build_docker_multi_platform.sh @@ -5,6 +5,7 @@ HELP="USAGE: sh build_docker.sh \n [ -t | --tag ] Select a tag for building. Default: latest \n [ -i | --image ] Select image tag for building. Default: dasmoorhuhn/atc-mithermometer-gateway \n [ -p | --platforms ] Select the platforms, for which the image should build. Default: linux/amd64,linux/arm64,linux/arm \n +[ -r | --release ] Build a release. Provide the Tag. \n [ -h | --help ] Get this dialog" docker buildx version @@ -31,6 +32,12 @@ while [ "$1" != "" ]; do TAG=$1 shift ;; + -r | --release ) + shift + TAG=$1 + RELEASE=true + shift + ;; -i | --image ) shift IMAGE=$1 @@ -52,4 +59,21 @@ while [ "$1" != "" ]; do esac done -build_docker \ No newline at end of file +if [ "$RELEASE" = true ]; then + branch=$(git symbolic-ref --short HEAD) + git fetch --prune --prune-tags -f + git checkout $TAG + echo ------------------------------------- + git branch + echo ------------------------------------- + git status + echo ------------------------------------- + echo "!!PLEASE CHECK OF THIS IS RIGHT!!" + sleep 10 + build_docker + TAG=latest + build_docker + git checkout $branch +else + build_docker +fi