1- .PHONY : test lint cover mock_wire mock_gen swag migrate_local
1+ .PHONY : test lint cover mock_wire mock_gen swag db_migrate db_rollback test_all lint_all
2+
3+ GO_TAGS := $(GO_TAGS )
24
35build :
4- go build -o ./bin/csghub-server ./cmd/csghub-server
6+ go build -tags " $( GO_TAGS ) " - o ./bin/csghub-server ./cmd/csghub-server
57
68test :
7- go test ./...
9+ go test -tags " $( GO_TAGS) " ./...
10+
11+ test_all :
12+ $(MAKE ) test GO_TAGS=ce
13+ $(MAKE ) test GO_TAGS=ee
14+ $(MAKE ) test GO_TAGS=saas
815
916lint :
10- golangci-lint run
17+ golangci-lint run --build-tags " $( GO_TAGS) "
18+
19+ lint_all :
20+ $(MAKE ) lint GO_TAGS=ce
21+ $(MAKE ) lint GO_TAGS=ee
22+ $(MAKE ) lint GO_TAGS=saas
1123
1224cover :
13- go test -coverprofile=cover.out ./...
25+ go test -tags " $( GO_TAGS ) " - coverprofile=cover.out ./...
1426 go tool cover -html=cover.out -o cover.html
1527 open cover.html
1628
@@ -27,19 +39,22 @@ mock_wire:
2739 fi
2840
2941mock_gen :
30- mockery
42+ mockery --tags " $( GO_TAGS ) "
3143
3244swag :
3345 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
3446
35- migrate_local :
36- go run cmd/csghub-server/main.go migration migrate --config local.toml
37-
3847db_migrate :
39- @go run cmd/csghub-server/main.go migration migrate --config local.toml
48+ @go run -tags " $( GO_TAGS ) " cmd/csghub-server/main.go migration migrate --config local.toml
4049
4150db_rollback :
42- @go run cmd/csghub-server/main.go migration rollback --config local.toml
51+ @go run -tags " $( GO_TAGS) " cmd/csghub-server/main.go migration rollback --config local.toml
52+
53+ start_server :
54+ @go run -tags " $( GO_TAGS) " cmd/csghub-server/main.go start server -l Info -f json --config local.toml
55+
56+ start_user :
57+ @go run -tags " $( GO_TAGS) " cmd/csghub-server/main.go user launch -l Info -f json --config local.toml
4358
4459error_doc :
4560 @go run cmd/csghub-server/main.go errorx doc-gen
@@ -48,4 +63,4 @@ error_scan:
4863 @go run cmd/csghub-server/main.go errorx scan --dir $(dir ) -v
4964
5065notify_gen :
51- @go run cmd/csghub-server/main.go notification notify-gen -l Info
66+ @go run cmd/csghub-server/main.go notification notify-gen -l Info
0 commit comments