mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-12 04:53:47 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -12,63 +12,52 @@ build:
|
||||
@cd ../web && yarn build && \cp -rf ./dist/* ../server$(ADMIN_RESOURCE_PATH)
|
||||
@echo "y" | gf build
|
||||
|
||||
|
||||
# 通过热编译启动所有服务
|
||||
.PHONY: all
|
||||
all:
|
||||
gf run main.go --args "all"
|
||||
|
||||
|
||||
.PHONY: http
|
||||
http:
|
||||
gf run main.go --args "http"
|
||||
|
||||
|
||||
.PHONY: queue
|
||||
queue:
|
||||
gf run main.go --args "queue"
|
||||
|
||||
|
||||
.PHONY: cron
|
||||
cron:
|
||||
gf run main.go --args "cron"
|
||||
|
||||
|
||||
.PHONY: auth
|
||||
auth:
|
||||
gf run main.go --args "auth"
|
||||
|
||||
|
||||
# 启动web服务
|
||||
.PHONY: web
|
||||
web:
|
||||
@cd ../web && yarn dev
|
||||
|
||||
|
||||
# 刷新casbin权限
|
||||
.PHONY: refresh
|
||||
refresh:
|
||||
@go run main.go tools -m=casbin -a1=refresh
|
||||
|
||||
|
||||
# 清理casbin权限
|
||||
.PHONY: clear
|
||||
clear:
|
||||
@go run main.go tools -m=casbin -a1=clear
|
||||
|
||||
|
||||
# 运行代码质量分析工具
|
||||
# https://github.com/ywanbing/golangci
|
||||
.PHONY: ci
|
||||
ci:
|
||||
.PHONY: lint
|
||||
lint:
|
||||
golangci-lint run
|
||||
|
||||
|
||||
.PHONY: killmain
|
||||
killmain:
|
||||
@kill -9 $(ps -ef|grep main|grep -v grep|awk '{print $2}')
|
||||
|
||||
|
||||
# Install/Update to the latest CLI tool.
|
||||
.PHONY: cli
|
||||
cli:
|
||||
@@ -78,7 +67,6 @@ cli:
|
||||
./gf install -y && \
|
||||
rm ./gf
|
||||
|
||||
|
||||
# Check and install CLI tool.
|
||||
.PHONY: cli.install
|
||||
cli.install:
|
||||
@@ -88,19 +76,16 @@ cli.install:
|
||||
make cli; \
|
||||
fi;
|
||||
|
||||
|
||||
# Generate Go files for DAO/DO/Entity.
|
||||
.PHONY: dao
|
||||
dao: cli.install
|
||||
@gf gen dao
|
||||
|
||||
|
||||
# Generate Go files for Service.
|
||||
.PHONY: service
|
||||
service: cli.install
|
||||
@gf gen service
|
||||
|
||||
|
||||
# Build image, deploy image and yaml to current kubectl environment and make port forward to local machine.
|
||||
.PHONY: start
|
||||
start:
|
||||
@@ -109,27 +94,19 @@ start:
|
||||
make deploy; \
|
||||
make port;
|
||||
|
||||
|
||||
# Build docker image and commit to the repository.
|
||||
# example: make image tag=v0.0.1
|
||||
.PHONY: image
|
||||
image:
|
||||
@echo "y" | gf docker main.go -p -tn hotgo:$(tag)
|
||||
|
||||
|
||||
# Deploy image and yaml to current kubectl environment.
|
||||
.PHONY: deploy
|
||||
deploy:
|
||||
$(eval _TAG = $(if ${TAG}, ${TAG}, develop))
|
||||
|
||||
@set -e; \
|
||||
mkdir -p $(ROOT_DIR)/temp/kustomize;\
|
||||
cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_TAG};\
|
||||
kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\
|
||||
kubectl apply -f $(ROOT_DIR)/temp/kustomize.yaml; \
|
||||
kubectl patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}";
|
||||
|
||||
|
||||
.PHONY: push
|
||||
push:
|
||||
@cd $(ROOT_DIR) && cd .. && ./push.sh
|
||||
|
Reference in New Issue
Block a user