generated from greenbone/go-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (30 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
all: api-docs build test
SWAG = github.com/swaggo/swag/cmd/[email protected]
MOCKERY = github.com/vektra/mockery/[email protected]
GOLANGCI-LINT = github.com/golangci/golangci-lint/cmd/golangci-lint@latest
.PHONY: lint
lint:
go run $(GOLANGCI-LINT) run
.PHONY: install-code-generation-tools
install-code-generation-tools:
go install $(SWAG)
go install $(MOCKERY)
.PHONY: generate-code
generate-code: # create mocks
go run $(MOCKERY)
.PHONY: api-docs
api-docs:
go run $(SWAG) init -d pkg/web --exclude pkg/web/healthcontroller -o api/notificationservice --parseDependency --generalInfo api.go --instanceName notificationservice
go run $(SWAG) init -d pkg/web/healthcontroller -o api/health --parseDependency --generalInfo api.go --instanceName health
.PHONY: build
build:
go build -o ./bin/ ./cmd/notification-service/
.PHONY: test
test: # run unit tests
go test ./... -cover
.PHONY: start-services
start-services: ## start service and dependencies with docker
docker compose -f docker-compose.yml -f docker-compose.service.yml up --build --abort-on-container-exit
.PHONY: cleanup-services
cleanup-services: # delete service, dependencies and all persistent data
docker compose -f docker-compose.yml -f docker-compose.service.yml down -v