api-gateway/deploy/image-build.sh
Piotr Biernat 7fb75167d4
All checks were successful
continuous-integration/drone/push Build is passing
Added wait-for-it.sh script
2022-12-06 06:16:56 +01:00

18 lines
467 B
Bash
Executable File

#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-gateway"
export BUILD_TIME=$(date +"%Y%m%d%H%M%S")
TARGET=${1:-latest}
echo "Building: $IMAGE_NAME:$TARGET"
if [ $TARGET = "dev" ]
then
docker build --build-arg BUILD_TIME --rm --no-cache -t "$IMAGE_NAME:dev" . # >/dev/null 2>&1
else
docker build --build-arg BUILD_TIME --rm --cache-from "$IMAGE_NAME:$TARGET" -t "$IMAGE_NAME:$TARGET" . >/dev/null 2>&1
fi
echo "Done."