代码拉取完成,页面将自动刷新
同步操作将从 fagongzi/gateway 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
RELEASE_VERSION = $(release_version)
ifeq ("$(RELEASE_VERSION)","")
RELEASE_VERSION := "unknown"
endif
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
VERSION_PATH = $(shell echo $(ROOT_DIR) | sed -e "s;${GOPATH}/src/;;g")pkg/util
LD_GIT_COMMIT = -X '$(VERSION_PATH).GitCommit=`git rev-parse --short HEAD`'
LD_BUILD_TIME = -X '$(VERSION_PATH).BuildTime=`date +%FT%T%z`'
LD_GO_VERSION = -X '$(VERSION_PATH).GoVersion=`go version`'
LD_GATEWAY_VERSION = -X '$(VERSION_PATH).Version=$(RELEASE_VERSION)'
LD_FLAGS = -ldflags "$(LD_GIT_COMMIT) $(LD_BUILD_TIME) $(LD_GO_VERSION) $(LD_GATEWAY_VERSION) -w -s"
GOOS = linux
CGO_ENABLED = 0
DIST_DIR = $(ROOT_DIR)dist/
ETCD_VER = v3.3.12
ETCD_DOWNLOAD_URL = https://github.com/coreos/etcd/releases/download
MY_TARGET := dist_dir
EXEC_NAME := proxy
IMAGE_NAME := gateway
CMD_NAME := demo
ifeq ("$(MAKECMDGOALS)","docker")
ifeq ("$(with)","")
MY_TARGET := release download_etcd ui
endif
ifeq ($(findstring etcd,$(with)),etcd)
MY_TARGET := $(MY_TARGET) download_etcd
EXEC_NAME := etcd
IMAGE_NAME = etcd
CMD_NAME = etcd
endif
ifeq ($(findstring apiserver,$(with)),apiserver)
MY_TARGET := $(MY_TARGET) apiserver ui
EXEC_NAME := apiserver
IMAGE_NAME = apiserver
CMD_NAME = apiserver
endif
ifeq ($(findstring proxy,$(with)),proxy)
MY_TARGET := $(MY_TARGET) proxy
EXEC_NAME := proxy
IMAGE_NAME = proxy
CMD_NAME = proxy
endif
endif
.PHONY: release
release: dist_dir apiserver proxy;
.PHONY: release_darwin
release_darwin: darwin dist_dir apiserver proxy;
.PHONY: docker
docker:
@$(MAKE) $(MY_TARGET)
@echo ========== current docker tag is: $(RELEASE_VERSION) ==========
docker build -t fagongzi/$(IMAGE_NAME):$(RELEASE_VERSION) \
--build-arg EXEC_NAME="$(EXEC_NAME)" \
--build-arg CMD_NAME="$(CMD_NAME)" \
-f Dockerfile .
docker tag fagongzi/$(IMAGE_NAME):$(RELEASE_VERSION) fagongzi/$(IMAGE_NAME)
.PHONY: ui
ui: ; $(info ======== compile ui:)
git clone https://github.com/fagongzi/gateway-ui-vue.git $(DIST_DIR)ui
cd $(DIST_DIR)ui && git checkout 3.0.0
.PHONY: darwin
darwin:
$(eval GOOS := darwin)
.PHONY: apiserver
apiserver: ; $(info ======== compiled apiserver:)
env GO111MODULE=off CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) go build -a -installsuffix cgo -o $(DIST_DIR)apiserver $(LD_FLAGS) $(ROOT_DIR)cmd/api/*.go
.PHONY: proxy
proxy: ; $(info ======== compiled proxy:)
env GO111MODULE=off CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) go build -a -installsuffix cgo -o $(DIST_DIR)proxy $(LD_FLAGS) $(ROOT_DIR)cmd/proxy/*.go
.PHONY: download_etcd
download_etcd:
curl -L $(ETCD_DOWNLOAD_URL)/$(ETCD_VER)/etcd-$(ETCD_VER)-linux-amd64.tar.gz -o /tmp/etcd-$(ETCD_VER)-linux-amd64.tar.gz
tar xzvf /tmp/etcd-$(ETCD_VER)-linux-amd64.tar.gz -C $(DIST_DIR) --strip-components=1
@rm -rf $(DIST_DIR)Documentation $(DIST_DIR)README*
.PHONY: dist_dir
dist_dir: ; $(info ======== prepare distribute dir:)
mkdir -p $(DIST_DIR)
@rm -rf $(DIST_DIR)*
@cp entrypoint.sh $(DIST_DIR)
.PHONY: clean
clean: ; $(info ======== clean all:)
rm -rf $(DIST_DIR)*
.PHONY: help
help:
@echo "build release binary: \n\t\tmake release\n"
@echo "build Mac OS X release binary: \n\t\tmake release_darwin\n"
@echo "build docker release with etcd: \n\t\tmake docker\n"
@echo "\t add 「with」 params can select what you need:\n"
@echo "\t default: all, like 「make docker」\n"
@echo "\t etcd: download and extract etcd and etcdctl\n"
@echo "\t proxy: only compile proxy\n"
@echo "\t apiserver: compile apiserver and download ui\n"
@echo "clean all binary: \n\t\tmake clean\n"
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
.DEFAULT_GOAL := release_darwin
else
.DEFAULT_GOAL := release
endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。