-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (50 loc) · 1.36 KB
/
Makefile
File metadata and controls
62 lines (50 loc) · 1.36 KB
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
BINARY = ctfzone
pkgs = $(shell go list ./...)
build:
@echo ">> building binaries"
@go build -ldflags "-s -w" -o ${BINARY}
clean:
@echo ">> cleaning binaries"
@if [ -f ${BINARY} ]; then rm ${BINARY}; fi
format:
@echo ">> formatting code"
@go fmt ${pkgs}
test:
@echo ">> running all tests"
@go test -p 1 ${pkgs}
tools:
@echo ">> install nesessary tools"
@go get -u github.com/jteeuwen/go-bindata/...
@go get -u github.com/vektra/mockery/...
pack-schemas:
@echo ">> writing json-schemas"
@go-bindata -pkg schemas \
-ignore ".*\.go" \
-prefix "controllers/schemas" \
-o controllers/schemas/bindata.go \
controllers/schemas/...
@go fmt ./controllers/schemas
pack-migrations:
@echo ">> writing migrations"
@go-bindata -pkg migrations \
-ignore ".*\.go" \
-prefix "models/migrations" \
-o models/migrations/bindata.go \
models/migrations/...
@go fmt ./models/migrations
mailer-mock:
@echo ">> generating mailer mock"
@mockery -dir modules/mailer \
-output modules/mailer/mock \
-outpkg mailer_mock \
-name Sender
@go fmt ./modules/mailer/mock
db-clean:
@echo ">> cleaning database"
@psql ${CTF_DB_DSN} -c "DROP OWNED BY ctfzone"
migrations-up:
@echo ">> migrations up"
@migrate -database ${CTF_DB_DSN} -path ./models/migrations up
migrations-down:
@echo ">> migrations down"
@migrate -database ${CTF_DB_DSN} -path ./models/migrations down