diff --git a/Makefile b/Makefile index 14e7bb17efdac..aaefcf00ffb3b 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)