added push release

This commit is contained in:
Kasper Juul Hermansen 2022-08-21 16:42:38 +02:00
parent 0babeff695
commit 0009680eaf
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 14 additions and 12 deletions

View File

@ -2,7 +2,9 @@
echo "building docker image"
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
base_tag="$REGISTRY/$SERVICE"
tag="$base_tag:${COMMIT_SHA:0:10}"
latest_tag="$base_tag:latest"
if [[ -n $DEBUG ]]
then
@ -13,4 +15,7 @@ then
echo " TMP: $TMP"
fi
DOCKER_BUILDKIT=1 docker build -t "$tag" -f "$TMP/build_release.Dockerfile" .
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
DOCKER_BUILDKIT=1 docker build --cache-from "$latest_tag" -t "$tag" -f "$TMP/build_release.Dockerfile" .
docker tag "$tag" "$latest"

View File

@ -2,20 +2,17 @@
set -e
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
base_tag="$REGISTRY/$SERVICE"
tag="$base_tag:${COMMIT_SHA:0:10}"
latest_tag="$base_tag:latest"
if [[ -n $DEBUG ]]
then
echo "debug:"
echo " REGISTRY: $REGISTRY"
echo " SERVICE: $SERVICE"
echo " COMMIT_SHA: $COMMIT_SHA"
echo " TMP: $TMP"
fi
export DOCKER_BUILDKIT=1
echo "docker: logging in"
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
echo "docker: pushing image $tag"
DOCKER_BUILDKIT=1 docker push "$tag"
docker push "$tag" &
docker push "$latest_tag" &
wait