-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
44 lines (35 loc) · 841 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
export FORCE_COLOR = true
PRE_COMMIT_HOOK_PATH = .git/hooks/pre-commit
PRE_COMMIT_TEMPLATE_HOOK_PATH = hooks/pre-commit.sh
.PHONY: bootstrap bootstrap-hooks test lint check
lint:
golint -set_exit_status app/...
test:
go test -v -race ./app/...
check:
make lint
make test
bootstrap-hooks:
make check-pre-commit-hook
cp $(PRE_COMMIT_TEMPLATE_HOOK_PATH) $(PRE_COMMIT_HOOK_PATH)
chmod +x $(PRE_COMMIT_HOOK_PATH)
bootstrap:
make check-go-mod
go mod download
go mod vendor
make check
make bootstrap-hooks
check-go-mod:
ifneq ($(GO111MODULE), on)
echo "Set GO111MODULE to 'on' first"
exit 1
else
echo "GO111MODULE is set"
endif
check-pre-commit-hook:
ifneq ("$(wildcard $(PRE_COMMIT_HOOK_PATH))", "")
echo "Pre-commit hook already exists, reseting"
rm $(PRE_COMMIT_HOOK_PATH)
else
echo "Pre-commit hook is missing"
endif