-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (38 loc) · 1.3 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
tag ?= latest
keys:
openssl genpkey -algorithm RSA -out ./rsa_private.pem -pkeyopt rsa_keygen_bits:2048
init:
pip install pre-commit
pre-commit clean
pre-commit install --install-hooks --overwrite
go install github.com/direnv/direnv@latest
direnv version
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
swagger version
check:
pre-commit run --verbose --all-files --show-diff-on-failure
smoke-test:
IMAGE_TAG=$(tag) docker compose up -d prod
docker-image:
IMAGE_TAG=$(tag) docker compose build prod
push-docker-image:
IMAGE_TAG=$(tag) docker compose push prod
dev:
docker compose --profile dev up
test:
go test -race ./...
test-coverage:
go test -coverprofile=./coverage.out ./... && go tool cover -html=./coverage.out -o ./coverage.html
clean-dev:
docker compose --profile dev down --remove-orphans --volumes
go clean
clean:
docker compose --profile prod down --remove-orphans --volumes
swagger-clean:
rm -f swagger/swagger.yaml
swagger-spec:
swagger generate spec -o swagger/swagger.yaml
swagger validate swagger/swagger.yaml
swagger: swagger-clean swagger-spec
.PHONY: keys init check smoke-test docker-image push-docker-image dev cluster-dev test test-coverage clean-dev clean-cluster-dev swagger-clean swagger-spec swagger