-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
62 lines (44 loc) · 1020 Bytes
/
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
PROJECT=covid-19-api
TAG:=$(shell git rev-parse HEAD)
BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
ifeq (,$(VERSION))
VERSION=latest
endif
keys:
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
tools:
go get github.com/oxequa/realize
go get github.com/golangci/golangci-lint
run:
realize start
run-api:
realize start -n covid-19
test:
go test -v ./...
.PHONY: linux
linux: GOOS := linux
linux: GOARCH := amd64
.PHONY: vendor
vendor:
go mod vendor
.PHONY: docker
docker: linux vendor
docker build -t $(PROJECT):$(VERSION) -f Dockerfile .
db-start:
docker-compose up -d
db-logs:
docker-compose logs -f
db: db-start db-logs
db-stop:
docker-compose stop
lint:
golangci-lint run -e vendor
clean-mongo:
docker-compose stop mongo
docker-compose rm -f -v mongo
docker volume rm -f data_mongo
clean-db: clean-mongo
# This included makefile should define the 'custom' target rule which is called here.
include $(INCLUDE_MAKEFILE)
.PHONY: release
release: custom