-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (51 loc) · 1.33 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
include Makefile.vars
.SILENT:
.DEFAULT_GOAL := help
.PHONY: help
help:
$(info Available Commands:)
$(info -> install installs project dependencies)
$(info -> test run all tests)
$(info -> test-unit run unit tests)
$(info -> lint check coding style)
$(info -> run run app)
$(info -> db-start starts development database)
$(info -> db-stop stops development database)
.PHONY: install
install:
go get github.com/google/wire/cmd/wire
go mod tidy -v
.PHONY: wire
wire:
wire $(SERVERDIR)
.PHONY: test
test:
go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic
.PHONY: test-unit
test-unit:
go test ./... -v -short -race -coverprofile=coverage.txt -covermode=atomic
.PHONY: lint
lint:
go get -u golang.org/x/lint/golint
golint ./...
.PHONY: run
run: wire
go run $(SERVERDIR)
.PHONY: db-start
db-start:
docker run -d \
--rm \
-p 3306:3306 \
--name mysql_maskada \
-e MYSQL_ROOT_PASSWORD=$(DATABASE_ROOT_PASSWORD) \
-e MYSQL_PASSWORD=$(DATABASE_PASSWORD) \
-e MYSQL_USER=$(DATABASE_USERNAME) \
-e MYSQL_DATABASE=$(DATABASE_NAME) \
-v $(CURDIR)/details/db/migrations:/docker-entrypoint-initdb.d/ \
mysql:8
.PHONY: db-stop
db-stop:
docker stop -t 2 mysql_maskada
# ignore unknown commands
%:
@: