From 943b1cb30e5a442aff7c390f4818326347c9abc8 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Wed, 12 Oct 2022 17:51:29 +0200 Subject: [PATCH] fixes --- Dockerfile | 1 + Makefile | 12 ++++++++++++ deploy/image-build.sh | 12 +++++++++++- test | 0 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Makefile delete mode 100644 test diff --git a/Dockerfile b/Dockerfile index 0396101..a0ec3de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM nginx:alpine LABEL author="Piotr Biernat" +LABEL service="api-gw" LABEL vendor="Egommerce" LABEL version="1.0" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1b190e9 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +DEPLOY_DIR := ./deploy +SRC_DIR := ./src + +## DEPLOY PART +build-image-dev: + - sh ${DEPLOY_DIR}/image-build.sh dev + +build-image-prod: + - sh ${DEPLOY_DIR}/image-build.sh + +push-image-prod: + - sh ${DEPLOY_DIR}/image-push.sh diff --git a/deploy/image-build.sh b/deploy/image-build.sh index 7eee911..d37a934 100755 --- a/deploy/image-build.sh +++ b/deploy/image-build.sh @@ -3,4 +3,14 @@ export IMAGE_NAME="git.pbiernat.dev/egommerce/apigw-svc" -docker build --rm --cache-from "$IMAGE_NAME:latest" -t "$IMAGE_NAME:latest" . +TARGET=${1:-latest} + +echo "Building: $IMAGE_NAME:$TARGET" +if [ $TARGET = "dev" ] +then + docker build --rm --no-cache -t "$IMAGE_NAME:dev" . >/dev/null 2>&1 +else + docker build --rm --cache-from "$IMAGE_NAME:$TARGET" -t "$IMAGE_NAME:$TARGET" . >/dev/null 2>&1 +fi + +echo "Done." diff --git a/test b/test deleted file mode 100644 index e69de29..0000000