Browse Source

update: 强制 git reset ,降低手工部署误操作的几率

dev
zhoushx1018 3 years ago
parent
commit
6ed171d190
  1. 10
      Makefile

10
Makefile

@ -61,13 +61,20 @@ all: build
# unittest:
# # @go test -v ./internal/...
buildquick:
gitReset:
@echo ==gitReset==
@git fetch --all;
@git reset --hard origin/$(GIT_BRANCH);
buildquick: gitReset
@echo ==buildquick==
@go mod tidy;
@echo GIT_BRANCH=$(GIT_BRANCH) GIT_HASH=$(GIT_HASH) K8S_DEPLOY_PARAM_IMAGE_TAG=$(K8S_DEPLOY_PARAM_IMAGE_TAG)
@echo BUILD_FLAGS=$(BUILD_FLAGS)
@go build $(BUILD_FLAGS) -o ./pack/service ./
docker: clean buildquick
@echo ==build docker image and push ==
## 非 x86_64平台,不允许做docker镜像的构建
@if [ "$(X86_64)" = "" ] ; then\
echo !!!! not x86_64 platform , can not build docker image !!!!!!!!; \
@ -88,6 +95,7 @@ docker: clean buildquick
fi
deployK8s: docker
@echo ==deploy to K8s==
@echo $(SHELL_EXPORT);
@if [ $(GIT_BRANCH) = $(BRANCH_TEST) ] || [ $(GIT_BRANCH) = $(BRANCH_STAGING) ] || [ $(GIT_BRANCH) = $(BRANCH_MASTER) ]; then\

Loading…
Cancel
Save