This commit is contained in:
sjk
2025-11-28 15:18:10 +08:00
parent ad4a600af9
commit 5683f35942
188 changed files with 53680 additions and 1062 deletions

View File

@@ -125,6 +125,44 @@ deploy-docker: ## 构建并推送 Docker 镜像
# docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
# docker push $(DOCKER_IMAGE):latest
# 多环境运行命令
.PHONY: run-dev
run-dev: ## 运行开发环境
cd $(SERVER_DIR) && GO_ENV=development go run cmd/server/main.go
.PHONY: run-test
run-test: ## 运行测试环境
cd $(SERVER_DIR) && GO_ENV=test go run cmd/server/main.go
.PHONY: run-prod
run-prod: ## 运行生产环境(通用)
cd $(SERVER_DIR) && GO_ENV=production go run cmd/server/main.go
.PHONY: run-prod-cn
run-prod-cn: ## 运行生产环境-中国区
cd $(SERVER_DIR) && GO_ENV=prod-cn go run cmd/server/main.go
.PHONY: run-prod-us
run-prod-us: ## 运行生产环境-美国区
cd $(SERVER_DIR) && GO_ENV=prod-us go run cmd/server/main.go
.PHONY: run-prod-eu
run-prod-eu: ## 运行生产环境-欧洲区
cd $(SERVER_DIR) && GO_ENV=prod-eu go run cmd/server/main.go
# 多环境构建命令
.PHONY: build-prod-cn
build-prod-cn: ## 构建中国区生产版本
cd $(SERVER_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -a -installsuffix cgo -o $(BINARY_NAME)-cn cmd/server/main.go
.PHONY: build-prod-us
build-prod-us: ## 构建美国区生产版本
cd $(SERVER_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -a -installsuffix cgo -o $(BINARY_NAME)-us cmd/server/main.go
.PHONY: build-prod-eu
build-prod-eu: ## 构建欧洲区生产版本
cd $(SERVER_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -a -installsuffix cgo -o $(BINARY_NAME)-eu cmd/server/main.go
# 工具命令
.PHONY: install-tools
install-tools: ## 安装开发工具