Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. compile: daemon-compile-x64-lin
  2. daemon-compile-armhf:
  3. GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/jamesread/OliveTin/cmd/OliveTin
  4. daemon-compile-x64-lin:
  5. GOOS=linux go build -o OliveTin github.com/jamesread/OliveTin/cmd/OliveTin
  6. daemon-compile-x64-win:
  7. GOOS=windows GOARCH=amd64 go build -o OliveTin.exe github.com/jamesread/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 3 cmd internal
  13. daemon-unittests:
  14. mkdir -p reports
  15. go test ./... -coverprofile reports/unittests.out
  16. go tool cover -html=reports/unittests.out -o reports/unittests.html
  17. go-tools:
  18. go install "github.com/bufbuild/buf/cmd/buf"
  19. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"
  20. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
  21. go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
  22. go install "google.golang.org/protobuf/cmd/protoc-gen-go"
  23. go install "github.com/fzipp/gocyclo/cmd/gocyclo"
  24. grpc: go-tools
  25. buf generate
  26. podman-image:
  27. buildah bud -t olivetin
  28. podman-container:
  29. podman kill olivetin
  30. podman rm olivetin
  31. podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
  32. podman start olivetin
  33. devrun: compile
  34. killall OliveTin || true
  35. ./OliveTin &
  36. devcontainer: compile podman-image podman-container
  37. webui-codestyle:
  38. cd webui && npm install
  39. cd webui && ./node_modules/.bin/eslint main.js js/*
  40. cd webui && ./node_modules/.bin/stylelint style.css
  41. clean:
  42. rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
  43. .PHONY: grpc