-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
72 lines (58 loc) · 1.43 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
60
61
62
63
64
65
66
67
68
69
70
71
72
PACKAGES=$(shell go list ./...)
LINTER_VERSION=1.53.3
lint:
goimports -w .
go mod verify
golangci-lint run --fix
.PHONY: lint
test:
GORACE="halt_on_error=1" go test -race ./...
.PHONY: test
test-integration:
GORACE="halt_on_error=1" go test -tags=integration -race ./...
.PHONY: test-integration
ci-lint:
fgt goimports -l .
go mod verify
golangci-lint run
.PHONY: ci-lint
ci-test: export AWS_ACCESS_KEY_ID := x
ci-test: export AWS_SECRET_ACCESS_KEY := x
ci-test: export SP_BSK_AWS_ENDPOINT := http://localhost:4566
ci-test:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
GORACE="halt_on_error=1" go test -race -cover -coverprofile=coverage.out $(pkg) || exit 1;\
tail -n +2 coverage.out >> coverage-all.out;)
.PHONY: ci-test
install-tools:
go install github.com/GeertJohan/fgt@latest
go install golang.org/x/tools/cmd/cover@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINTER_VERSION)
.PHONY: install-tools
### Docker ###
up:
docker-compose up --remove-orphans
.PHONY: up
up-build:
docker-compose up --remove-orphans --build
.PHONY: up-build
up-daemon:
docker-compose run --rm starter
.PHONY: up-daemon
down:
docker-compose down -v
.PHONY: down
ps:
docker-compose ps
.PHONY: ps
logs:
docker-compose logs -f bsk
.PHONY: logs
restart:
docker-compose restart bsk
.PHONY: restart
bash:
docker-compose exec bsk bash
.PHONY: bash