-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
59 lines (46 loc) · 1.13 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
API_NAME=manager
RUNNER_NAME=runner
.PHONY: build/api
build/api: docs
@echo "Building..."
@go build -o bin/$(API_NAME) cmd/$(API_NAME)/main.go
.PHONY: build/runner
build/runner:
@echo "Building..."
@go build -o bin/$(RUNNER_NAME) cmd/$(RUNNER_NAME)/main.go
.PHONY: run/api
run/api: dev/up
@echo "Running..."
@bin/$(API_NAME)
.PHONY: run/runner
run/runner: dev/up
@echo "Running..."
@bin/$(RUNNER_NAME) --max-concurrent-jobs=2000
.PHONY: dev/up
dev/up:
@echo "Starting dev environment..."
@docker compose -f docker-compose.dev.yml up -d
.PHONY: dev/down
dev/down:
@echo "Stopping dev environment..."
@docker compose -f docker-compose.dev.yml down
.PHONY: test
test:
@echo "Running tests..."
@go test -v --race ./...
.PHONY: db/migrate
db/migrate: dev/up
@echo "Running migrations..."
@go run cmd/tooling/main.go migrate --host=localhost:5436
.PHONY: get/api/flags
get/api/flags:
@echo "Getting flags..."
@go run cmd/$(API_NAME)/main.go --help
.PHONY: get/runner/flags
get/runner/flags:
@echo "Getting flags..."
@go run cmd/$(RUNNER_NAME)/main.go --help
.PHONY: docs
docs:
@echo "Generating docs..."
@swag init -g handlers/doc.go