-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
84 lines (62 loc) · 2.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# run: make theme && head internal/theme/bindata.go
SHELL := /bin/bash
.PHONY: compose test
build: clean theme
go build -o ./monako github.com/snipem/monako/cmd/monako
clean:
-rm -r compose
-rm ./monako
deps:
go mod download
go install github.com/kevinburke/go-bindata/v4/...@latest
optional_deps:
gem install asciidoctor asciidoctor-diagram
init: deps theme
theme: clean
go generate cmd/monako/main.go
update_theme:
git submodule update
secrets:
touch configs/secrets.env && source configs/secrets.env
test: clean_test
go test -covermode=count -coverprofile=coverage.out.tmp ./...
cat coverage.out.tmp | grep -v "/bindata.go" > coverage.out
rm coverage.out.tmp
clean_test:
rm -r tmp/testdata/ || true
test_deps:
go get golang.org/x/tools/cmd/cover
clones_for_local_testing:
git clone https://github.com/snipem/monako-test.git ${HOME}/temp/monako-testrepos/monako-test
git clone https://github.com/gohugoio/hugo.git ${HOME}/temp/monako-testrepos/hugo
# Use this for local tests, uses the locally cloned test data from test_data step
test_local:
MONAKO_TEST_REPO="${HOME}/temp/monako-testrepos/monako-test" $(MAKE) test
benchmark:
go test -v ./pkg/compose/ -run=BenchmarkHugeRepositories -bench=Benchmark. -benchtime=10s
run_prd: build secrets
env | grep USER
./monako -config ~/work/mopro/architecture/documentation/conf/config.prod.yaml \
-menu-config ~/work/mopro/architecture/documentation/conf/menu.prod.md \
-base-url http://localhost:8000
$(MAKE) serve
run: build compose serve
run_local: clean build
# Runs locally, clones this git repo to use test data
./monako -config test/config.local.yaml -menu-config test/config.menu.local.md
$(MAKE) serve
trace:
go test -trace=tmp/trace.out ./cmd/monako
go tool trace ./cmd/monako/ tmp/trace.out
compose:
./monako \
-fail-on-error \
-config configs/config.monako.yaml \
-menu-config configs/config.menu.md
serve:
echo "Serving under http://localhost:8000"
/usr/bin/env python3 -m http.server 8000 --directory compose/public
# setup git hooks
hooks:
which golangci-lint || brew install golangci/tap/golangci-lint
git config --local core.hooksPath githooks/