Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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: githooks go-tools
  29. buf generate
  30. podman-image:
  31. buildah bud -t olivetin
  32. podman-container:
  33. podman kill olivetin
  34. podman rm olivetin
  35. podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
  36. podman start olivetin
  37. integration-tests-docker-image:
  38. docker rm -f olivetin && docker rmi -f olivetin
  39. docker build -t olivetin:latest .
  40. docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
  41. devrun: compile
  42. killall OliveTin || true
  43. ./OliveTin &
  44. devcontainer: compile podman-image podman-container
  45. webui-codestyle:
  46. cd webui && npm install
  47. cd webui && ./node_modules/.bin/eslint main.js js/*
  48. cd webui && ./node_modules/.bin/stylelint style.css
  49. clean:
  50. rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
  51. .PHONY: grpc