-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile
83 lines (61 loc) · 2.27 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
compile: daemon-compile-x64-lin
daemon-compile-armhf:
GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile-x64-lin:
GOOS=linux go build -o OliveTin github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile-x64-win:
GOOS=windows GOARCH=amd64 go build -o OliveTin.exe github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile: daemon-compile-armhf daemon-compile-x64-lin daemon-compile-x64-win
daemon-codestyle:
go fmt ./...
go vet ./...
gocyclo -over 4 cmd internal
gocritic check ./...
daemon-unittests:
mkdir -p reports
go test ./... -coverprofile reports/unittests.out
go tool cover -html=reports/unittests.out -o reports/unittests.html
it:
cd integration-tests && make
githooks:
cp -v .githooks/* .git/hooks/
go-tools:
go install "github.com/bufbuild/buf/cmd/buf"
go install "github.com/fzipp/gocyclo/cmd/gocyclo"
go install "github.com/go-critic/go-critic/cmd/gocritic"
go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"
go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
go install "google.golang.org/protobuf/cmd/protoc-gen-go"
grpc: go-tools
buf generate
dist: protoc
protoc:
protoc --go_out=. --go-grpc_out=. --grpc-gateway_out=. -I .:/usr/include/ OliveTin.proto
podman-image:
buildah bud -t olivetin
podman-container:
podman kill olivetin || true
podman rm olivetin || true
podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
podman start olivetin
integration-tests-docker-image:
docker rm -f olivetin && docker rmi -f olivetin
docker build -t olivetin:latest .
docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
devrun: compile
killall OliveTin || true
./OliveTin &
devcontainer: compile podman-image podman-container
webui-codestyle:
cd webui.dev && npm install
cd webui.dev && ./node_modules/.bin/eslint main.js js/*
cd webui.dev && ./node_modules/.bin/stylelint style.css
webui-dist:
rm -rf webui webui.dev/dist
cd webui.dev && npm install
cd webui.dev && parcel build --public-url "." && mv dist ../webui
cp webui.dev/*.png webui/
clean:
rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
.PHONY: grpc