|
|
@ -14,12 +14,14 @@ GOBIN = $(shell pwd)/build/bin |
|
|
|
GO ?= latest |
|
|
|
|
|
|
|
# variables
|
|
|
|
NAME_DEV=develop |
|
|
|
NAME_TEST=test |
|
|
|
NAME_STAGING=staging |
|
|
|
NAME_MASTER=master |
|
|
|
|
|
|
|
RD_SUFFIX=rd |
|
|
|
|
|
|
|
BRANCH_DEV=$(NAME_DEV)-$(RD_SUFFIX) |
|
|
|
BRANCH_TEST=$(NAME_TEST)-$(RD_SUFFIX) |
|
|
|
BRANCH_STAGING=$(NAME_STAGING)-$(RD_SUFFIX) |
|
|
|
BRANCH_MASTER=$(NAME_MASTER)-$(RD_SUFFIX) |
|
|
@ -85,7 +87,7 @@ docker: clean buildquick |
|
|
|
@echo ACR_PREFIX=$(ACR_PREFIX); |
|
|
|
@echo CURR_MODEL_NAME=$(CURR_MODEL_NAME); |
|
|
|
@echo GIT_BRANCH=$(GIT_BRANCH); |
|
|
|
@if [ $(GIT_BRANCH) = $(BRANCH_TEST) ] || [ $(GIT_BRANCH) = $(BRANCH_STAGING) ] || [ $(GIT_BRANCH) = $(BRANCH_MASTER) ]; then\
|
|
|
|
@if [[ $(GIT_BRANCH) = $(BRANCH_DEV) || $(GIT_BRANCH) = $(BRANCH_TEST) || $(GIT_BRANCH) = $(BRANCH_STAGING) || $(GIT_BRANCH) = $(BRANCH_MASTER) ]]; then\
|
|
|
|
cd pack;\
|
|
|
|
docker build -t $(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG) .;\
|
|
|
|
docker tag $(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG) $(ACR_PREFIX)/$(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG); \
|
|
|
@ -98,7 +100,7 @@ deployK8s: docker |
|
|
|
@echo ==deploy to K8s== |
|
|
|
@echo $(SHELL_EXPORT); |
|
|
|
|
|
|
|
@if [ $(GIT_BRANCH) = $(BRANCH_TEST) ] || [ $(GIT_BRANCH) = $(BRANCH_STAGING) ] || [ $(GIT_BRANCH) = $(BRANCH_MASTER) ]; then\
|
|
|
|
@if [[ $(GIT_BRANCH) = $(BRANCH_DEV) || $(GIT_BRANCH) = $(BRANCH_TEST) || $(GIT_BRANCH) = $(BRANCH_STAGING) || $(GIT_BRANCH) = $(BRANCH_MASTER) ]]; then\
|
|
|
|
$(SHELL_EXPORT) envsubst < deployK8s.yaml > $(TMP_FILE_DEPLOY) ; kubectl apply -f $(TMP_FILE_DEPLOY) ; \
|
|
|
|
kubectl replace -f $(TMP_FILE_DEPLOY) --force; \
|
|
|
|
else \
|
|
|
|