-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
55 lines (40 loc) · 1.21 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
IMAGE := "nuetoban/crocodile"
TAG := $(shell git describe --tags)
.PHONY: build run docker-build docker-tag docker-push migrate-up migrate-down get test graph wc
default: build
docker-build:
docker build -t crocodile .
docker-tag:
docker tag crocodile nuetoban/crocodile:$(TAG)
docker-push:
docker push nuetoban/crocodile:$(TAG)
docker-full: docker-build docker-tag docker-push
deploy: docker-full
helm \
--namespace crocodile-prod \
upgrade crocodile ./helm \
-f helm/values-prod.yaml \
--set tag=$(TAG)
migrate-up:
migrate -source file://migrations \
-database 'postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable' up
migrate-down:
migrate -source file://migrations -database \
'postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable' down 1
run:
go run .
build:
go build -a \
-ldflags '-linkmode external -extldflags "-static"' \
-o crocodile-server .
get:
go get -v ./...
test:
go test ./...
graph:
go get -u github.com/TrueFurby/go-callvis
go-callvis -focus github.com/nuetoban/crocodile-game-bot/crocodile \
-group pkg,type -nostd -format=png \
-ignore github.com/sirupsen/logrus . | dot -Tpng -o crocodile.png
wc:
find . -name '*.go' | xargs cat | wc -l