cuddle-rust-service-plan/scripts/build_release.sh
2022-08-21 16:42:38 +02:00

22 lines
487 B
Bash
Executable File

#!/bin/bash
echo "building docker image"
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
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"