From 65448773aa0e00c211752953b00c9cfa8f899566 Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Tue, 2 Apr 2024 21:04:38 +0200 Subject: [PATCH] add usage info for ./build.sh --- app/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/build.sh b/app/build.sh index 87cc79f..25c5547 100755 --- a/app/build.sh +++ b/app/build.sh @@ -1,4 +1,12 @@ #!/bin/bash +# Usage: ./build.sh [dev|rc|rel] +# dev: development build +# rc: release candidate build +# rel: release build and push to ghcr.io +# Note: for release build, you need to set GHCR_TOKEN +# export GHCR_TOKEN= +# see also: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry + set -e @@ -27,6 +35,8 @@ elif [[ $1 == rc ]];then docker build --build-arg "VERSION=${VERSION}" --build-arg environment=production --label "org.label-schema.build-date=${BUILD_DATE}" --label "org.opencontainers.image.version=${VERSION}" -t ${IMAGE}:latest app elif [[ $1 == rel ]];then docker build --no-cache --build-arg "VERSION=${VERSION}" --build-arg environment=production --label "org.label-schema.build-date=${BUILD_DATE}" --label "org.opencontainers.image.version=${VERSION}" -t ${IMAGE}:latest -t ${IMAGE}:${MAJOR} -t ${IMAGE}:${VERSION} app +echo 'login to ghcr.io' +echo $GHCR_TOKEN | docker login ghcr.io -u s-allius --password-stdin docker push ghcr.io/s-allius/tsun-gen3-proxy:latest docker push ghcr.io/s-allius/tsun-gen3-proxy:${MAJOR} docker push ghcr.io/s-allius/tsun-gen3-proxy:${VERSION}