Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (66 loc) · 1.38 KB
/
Copy pathMakefile
File metadata and controls
80 lines (66 loc) · 1.38 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY: all \
serve \
ti test-integration \
swag swagger \
sch schema \
gen generate \
mig migrate \
seeds \
db-up database-up \
db-down database-down
all: serve
%:
@:
s: serve
serve:
air
# Test with optional module parameter
t: test
test:
@if [ -z "$(module)" ]; then \
go test -v $$(go list ./... | grep -v 'ent/\|docs/\|_integration_test.go') -tags=production; \
else \
go test -v api5back/src/$(module) -tags=production; \
fi
# Test integration with optional module parameter
ti: test-integration
test-integration:
$(MAKE) gen
@if [ -z "$(module)" ]; then \
go test -p 1 -v $$(go list ./... | grep -v 'ent/\|docs/') -tags=integration; \
else \
go test -p 1 -v api5back/src/$(module) -tags=integration; \
fi
swag: swagger
swagger:
swag init
sch:
go run scripts/schema/main.go $(filter-out $@,$(MAKECMDGOALS))
@:
schema:
go run scripts/schema/main.go $(filter-out $@,$(MAKECMDGOALS))
@:
gen: generate
generate:
go run scripts/generate/main.go
mig: migrate
migrate:
go run scripts/migrate/main.go
seeds:
go run scripts/seeds/main.go $(filter-out $@,$(MAKECMDGOALS))
@:
sy:
go run scripts/seeds/main.go $(filter-out $@,$(MAKECMDGOALS)) -y
@:
seeds-y:
go run scripts/seeds/main.go $(filter-out $@,$(MAKECMDGOALS)) -y
@:
db-up: database-up
database-up:
docker-compose up -d
db-down: database-down
database-down:
docker-compose down
h: hooks
hooks:
husky install