Skip to content

Commit 5bf4130

Browse files
author
Dev Agent
committed
update makefile
1 parent 89b5266 commit 5bf4130

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

Makefile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
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

35
build:
4-
go build -o ./bin/csghub-server ./cmd/csghub-server
6+
go build -tags "$(GO_TAGS)" -o ./bin/csghub-server ./cmd/csghub-server
57

68
test:
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

916
lint:
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

1224
cover:
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

2941
mock_gen:
30-
mockery
42+
mockery --tags "$(GO_TAGS)"
3143

3244
swag:
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-
3847
db_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

4150
db_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

4459
error_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

5065
notify_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

Comments
 (0)