-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (39 loc) · 1.04 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
NOCOL=\x1b[0m
GREEN=\x1b[32;01m
RED=\x1b[31;01m
YELLOW=\x1b[33;01m
define print_title
@echo "---"
@echo "--- $(GREEN)$1$(NOCOL)"
@echo "---"
endef
default: get lint format test build-bin
get:
go get -t ./...
test:
$(call print_title, Running tests...)
go test -v `go list ./...`
build: build-bin build-docker
build-bin:
$(call print_title,Building binaries...)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server/bin/dummy-loader github.com/sha1n/dummy-loader/server
build-docker:
$(call print_title,Building docker image...)
docker build -t sha1n/dummy-loader server
prepare:
$(call print_title,Preparing go dependencies...)
dep ensure -v
format:
$(call print_title,Formatting go sources...)
gofmt -s -w server
lint:
$(call print_title,Lint...)
gofmt -d server
push-docker:
$(call print_title,Publishing docker image...)
docker push sha1n/dummy-loader:latest
run-docker:
docker run -d -p 8080:8080 sha1n/dummy-loader
release: prepare format lint test build push-docker
setup:
git config core.hooksPath .git-hooks