-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
144 lines (130 loc) · 6.54 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
export GO111MODULE=on
debug:
go run cmd/leprechaun/main.go --pid=./var/run/leprechaun/.pid --ini=./dist/configs/config.ini --debug=true
setup:
mkdir /etc/leprechaun
mkdir /etc/leprechaun/recipes
cp dist/configs/config.ini /etc/leprechaun
mkdir /var/run/leprechaun/
mkdir /var/log/leprechaun/
mkdir /var/log/leprechaun/workers.output
touch /var/log/leprechaun/info.log
touch /var/log/leprechaun/error.log
install:
make setup
go mod vendor
go build -o $(GOPATH)/bin/leprechaun ./cmd/leprechaun
go build -o $(GOPATH)/bin/lepretools ./cmd/lepretools
install-remote-service:
make setup
go build -tags remote -o $(GOPATH)/bin/leprechaunrmt ./cmd/leprechaun
uninstall:
rm -rf /etc/leprechaun
rm -rf /var/log/leprechaun
rm -rf /var/run/leprechaun
build:
go build ./cmd/leprechaun
go build ./cmd/lepretools
build-remote-service:
go build -tags remote -o ./leprechaunrmt ./cmd/leprechaun
#can be used to test secure connection between remote and client
self-ca:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
rebuild:
go clean
make build
format:
gofmt -s -w .
test-package:
RUN_MODE=test go test -race ./${package} -coverprofile coverprofile/${package}.out -v
go tool cover -html=coverprofile/${package}.out -o coverprofile/${package}.html
test-verbose:
go vet ./cmd/leprechaun
go vet ./cmd/lepretools
cd client && go vet
cd log && go vet
cd recipe && go vet
cd recipe/schedule && go vet
cd config && go vet
cd context && go vet
cd workers && go vet
cd server && go vet
cd agent && go vet
cd api && go vet
RUN_MODE=test go test -race ./client -coverprofile=./client/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./config -coverprofile=./config/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./context -coverprofile=./context/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./log -coverprofile=./log/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./workers -coverprofile=./workers/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./server -coverprofile=./server/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./api -coverprofile=./api/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./agent -coverprofile=./agent/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./recipe -coverprofile=./api/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./cron -coverprofile=./cron/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./notifier -coverprofile=./notifier/coverage.txt -covermode=atomic -v
RUN_MODE=test go test -race ./notifier/notifications -coverprofile=./notifier/notifications/coverage.txt -v
RUN_MODE=test go test -race ./daemon -coverprofile=./daemon/coverage.txt -v
RUN_MODE=test go test -race ./remote -coverprofile=./remote/coverage.txt -v
test:
go vet ./cmd/leprechaun
go vet ./cmd/lepretools
cd client && go vet
cd log && go vet
cd recipe && go vet
cd recipe/schedule && go vet
cd config && go vet
cd context && go vet
cd workers && go vet
cd server && go vet
cd agent && go vet
cd api && go vet
RUN_MODE=test go test -race ./client -coverprofile=./client/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./config -coverprofile=./config/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./context -coverprofile=./context/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./log -coverprofile=./log/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./workers -coverprofile=./workers/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./server -coverprofile=./server/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./api -coverprofile=./api/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./agent -coverprofile=./agent/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./recipe -coverprofile=./api/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./cron -coverprofile=./cron/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./notifier -coverprofile=./notifier/coverage.txt -covermode=atomic
RUN_MODE=test go test -race ./notifier/notifications -coverprofile=./notifier/notifications/coverage.txt
RUN_MODE=test go test -race ./daemon -coverprofile=./daemon/coverage.txt
RUN_MODE=test go test -race ./remote -coverprofile=./remote/coverage.txt
test-with-report:
go vet ./cmd/leprechaun
go vet ./cmd/lepretools
cd client && go vet
cd log && go vet
cd recipe && go vet
cd recipe/schedule && go vet
mkdir -p coverprofile
RUN_MODE=test go test -race ./client -coverprofile coverprofile/client.out
go tool cover -html=coverprofile/client.out -o coverprofile/client.html
RUN_MODE=test go test -race ./config -coverprofile coverprofile/config.out
go tool cover -html=coverprofile/config.out -o coverprofile/config.html
RUN_MODE=test go test -race ./context -coverprofile coverprofile/context.out
go tool cover -html=coverprofile/context.out -o coverprofile/context.html
RUN_MODE=test go test -race ./log -coverprofile coverprofile/log.out
go tool cover -html=coverprofile/log.out -o coverprofile/log.html
RUN_MODE=test go test -race ./workers -coverprofile coverprofile/workers.out
go tool cover -html=coverprofile/workers.out -o coverprofile/workers.html
RUN_MODE=test go test -race ./server -coverprofile coverprofile/server.out
go tool cover -html=coverprofile/server.out -o coverprofile/server.html
RUN_MODE=test go test -race ./api -coverprofile coverprofile/api.out
go tool cover -html=coverprofile/api.out -o coverprofile/api.html
RUN_MODE=test go test -race ./agent -coverprofile coverprofile/agent.out
go tool cover -html=coverprofile/agent.out -o coverprofile/agent.html
RUN_MODE=test go test -race ./recipe -coverprofile coverprofile/recipe.out
go tool cover -html=coverprofile/recipe.out -o coverprofile/recipe.html
RUN_MODE=test go test -race ./cron -coverprofile coverprofile/cron.out
go tool cover -html=coverprofile/cron.out -o coverprofile/cron.html
RUN_MODE=test go test -race ./notifier -coverprofile coverprofile/notifier.out
go tool cover -html=coverprofile/notifier.out -o coverprofile/notifier.html
RUN_MODE=test go test -race ./notifier/notifications -coverprofile coverprofile/notifications.out
go tool cover -html=coverprofile/notifications.out -o coverprofile/notifications.html
RUN_MODE=test go test -race ./daemon -coverprofile coverprofile/daemon.out
go tool cover -html=coverprofile/daemon.out -o coverprofile/daemon.html
RUN_MODE=test go test -race ./remote -coverprofile coverprofile/remote.out
go tool cover -html=coverprofile/remote.out -o coverprofile/remote.html