From c26f7587f88b680b61cf8bfd6eab6fe1a28e1095 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kovalenko Date: Mon, 18 Mar 2024 20:38:17 +0200 Subject: [PATCH] Added docker-build & docker-push targets to Makefile --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 14e7bb17efdac..785fc56c8ebd7 100644 --- a/Makefile +++ b/Makefile @@ -115,3 +115,23 @@ report-celery-beat: admin-user: superset fab create-admin + +############ Docker image targets ############ + +AIRGAP_REGISTRY ?= lr1-bd-harbor-registry.mip.storage.hpecorp.net/develop +IMG_NAME := gcr.io/mapr-252711/superset/superset +GIT_HASH := $(shell git log -n1 --pretty=%h) +IS_DIRTY := $(shell git diff-index --quiet HEAD -- || echo "-is-dirty") +IMG_TAG ?= 3.1.0-hpe-ezaf-$(GIT_HASH)$(IS_DIRTY) + +docker-build: + docker build . -t $(IMG_NAME):$(IMG_TAG) + $(ifneq(,$(AIRGAP_REGISTRY))) + docker tag $(IMG_NAME):$(IMG_TAG) $(AIRGAP_REGISTRY)/$(IMG_NAME):$(IMG_TAG) + $(endif) + +docker-push: + docker push $(IMG_NAME):$(IMG_TAG) + $(ifneq(,$(AIRGAP_REGISTRY))) + docker push ${AIRGAP_REGISTRY}/${IMG_NAME}:${IMG_TAG} + $(endif) \ No newline at end of file