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