From 6ed171d19060ab224207423e85d8f05e4251826a Mon Sep 17 00:00:00 2001 From: zhoushx1018 Date: Fri, 22 Apr 2022 13:10:48 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=BC=BA=E5=88=B6=20git=20reset=20?= =?UTF-8?q?=20=20=EF=BC=8C=E9=99=8D=E4=BD=8E=E6=89=8B=E5=B7=A5=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E8=AF=AF=E6=93=8D=E4=BD=9C=E7=9A=84=E5=87=A0=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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\