From 5bf413060d137fad2d7df560b106414ffbcdc11a Mon Sep 17 00:00:00 2001 From: Dev Agent Date: Tue, 30 Dec 2025 08:24:56 +0000 Subject: [PATCH] update makefile --- Makefile | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 386b8eda7..426965674 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,28 @@ -.PHONY: test lint cover mock_wire mock_gen swag migrate_local +.PHONY: test lint cover mock_wire mock_gen swag db_migrate db_rollback test_all lint_all + +GO_TAGS := $(GO_TAGS) build: - go build -o ./bin/csghub-server ./cmd/csghub-server + go build -tags "$(GO_TAGS)" -o ./bin/csghub-server ./cmd/csghub-server test: - go test ./... + go test -tags "$(GO_TAGS)" ./... + +test_all: + $(MAKE) test GO_TAGS=ce + $(MAKE) test GO_TAGS=ee + $(MAKE) test GO_TAGS=saas lint: - golangci-lint run + golangci-lint run --build-tags "$(GO_TAGS)" + +lint_all: + $(MAKE) lint GO_TAGS=ce + $(MAKE) lint GO_TAGS=ee + $(MAKE) lint GO_TAGS=saas cover: - go test -coverprofile=cover.out ./... + go test -tags "$(GO_TAGS)" -coverprofile=cover.out ./... go tool cover -html=cover.out -o cover.html open cover.html @@ -27,19 +39,22 @@ mock_wire: fi mock_gen: - mockery + mockery --tags "$(GO_TAGS)" swag: swag init --pd -d cmd/csghub-server/cmd/start,api/router,api/handler,builder/store/database,common/types,accounting/handler,user/handler,moderation/handler,component,dataviewer/handler,aigateway/handler,aigateway/types,notification/handler -g server.go -migrate_local: - go run cmd/csghub-server/main.go migration migrate --config local.toml - db_migrate: - @go run cmd/csghub-server/main.go migration migrate --config local.toml + @go run -tags "$(GO_TAGS)" cmd/csghub-server/main.go migration migrate --config local.toml db_rollback: - @go run cmd/csghub-server/main.go migration rollback --config local.toml + @go run -tags "$(GO_TAGS)" cmd/csghub-server/main.go migration rollback --config local.toml + +start_server: + @go run -tags "$(GO_TAGS)" cmd/csghub-server/main.go start server -l Info -f json --config local.toml + +start_user: + @go run -tags "$(GO_TAGS)" cmd/csghub-server/main.go user launch -l Info -f json --config local.toml error_doc: @go run cmd/csghub-server/main.go errorx doc-gen @@ -48,4 +63,4 @@ error_scan: @go run cmd/csghub-server/main.go errorx scan --dir $(dir) -v notify_gen: - @go run cmd/csghub-server/main.go notification notify-gen -l Info \ No newline at end of file + @go run cmd/csghub-server/main.go notification notify-gen -l Info