Browse Source

fix and update: 修复条件判断, 新增 devlop-rd 分支

dev
zhoushx1018 3 years ago
parent
commit
708b71d4dd
  1. 6
      Makefile

6
Makefile

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

Loading…
Cancel
Save