diff --git a/Makefile b/Makefile index c3cd19c..ae3e75c 100644 --- a/Makefile +++ b/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\