Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. compile: daemon-compile-x64-lin
  2. daemon-compile-armhf:
  3. GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/OliveTin/OliveTin/cmd/OliveTin
  4. daemon-compile-x64-lin:
  5. GOOS=linux go build -o OliveTin github.com/OliveTin/OliveTin/cmd/OliveTin
  6. daemon-compile-x64-win:
  7. GOOS=windows GOARCH=amd64 go build -o OliveTin.exe github.com/OliveTin/OliveTin/cmd/OliveTin
  8. daemon-compile: daemon-compile-armhf daemon-compile-x64-lin daemon-compile-x64-win
  9. daemon-codestyle:
  10. go fmt ./...
  11. go vet ./...
  12. gocyclo -over 4 cmd internal
  13. gocritic check ./...
  14. daemon-unittests:
  15. mkdir -p reports
  16. go test ./... -coverprofile reports/unittests.out
  17. go tool cover -html=reports/unittests.out -o reports/unittests.html
  18. githooks:
  19. cp -v .githooks/* .git/hooks/
  20. go-tools:
  21. go install "github.com/bufbuild/buf/cmd/buf"
  22. go install "github.com/fzipp/gocyclo/cmd/gocyclo"
  23. go install "github.com/go-critic/go-critic/cmd/gocritic"
  24. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"
  25. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
  26. go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
  27. go install "google.golang.org/protobuf/cmd/protoc-gen-go"
  28. grpc: go-tools
  29. buf generate
  30. dist: protoc
  31. protoc:
  32. protoc --go_out=. --go-grpc_out=. --grpc-gateway_out=. -I .:/usr/include/ OliveTin.proto
  33. podman-image:
  34. buildah bud -t olivetin
  35. podman-container:
  36. podman kill olivetin || true
  37. podman rm olivetin || true
  38. podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
  39. podman start olivetin
  40. integration-tests-docker-image:
  41. docker rm -f olivetin && docker rmi -f olivetin
  42. docker build -t olivetin:latest .
  43. docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
  44. devrun: compile
  45. killall OliveTin || true
  46. ./OliveTin &
  47. devcontainer: compile podman-image podman-container
  48. webui-codestyle:
  49. cd webui.dev && npm install
  50. cd webui.dev && ./node_modules/.bin/eslint main.js js/*
  51. cd webui.dev && ./node_modules/.bin/stylelint style.css
  52. webui-dist:
  53. rm -rf webui webui.dev/dist
  54. cd webui.dev && npm install
  55. cd webui.dev && parcel build --public-url "." && mv dist ../webui
  56. cp webui.dev/*.png webui/
  57. clean:
  58. rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
  59. .PHONY: grpc