Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. -include local/Makefile
  2. .PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean
  3. all: deps build
  4. deps-go:
  5. go run build.go setup
  6. deps-js: node_modules
  7. deps: deps-js
  8. build-go:
  9. @echo "build go files"
  10. GO111MODULE=on go run build.go build
  11. build-server:
  12. @echo "build server"
  13. GO111MODULE=on go run build.go build-server
  14. build-cli:
  15. @echo "build in CI environment"
  16. GO111MODULE=on go run build.go build-cli
  17. build-js:
  18. @echo "build frontend"
  19. yarn run build
  20. build: build-go build-js
  21. build-docker-dev:
  22. @echo "build development container"
  23. @echo "\033[92mInfo:\033[0m the frontend code is expected to be built already."
  24. GO111MODULE=on go run build.go -goos linux -pkg-arch amd64 ${OPT} build pkg-archive latest
  25. cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
  26. cd packaging/docker && docker build --tag grafana/grafana:dev .
  27. build-docker-full:
  28. @echo "build docker container"
  29. docker build --tag grafana/grafana:dev .
  30. lint-go:
  31. @echo "lint go source"
  32. scripts/backend-lint.sh
  33. test-go:
  34. @echo "test backend"
  35. GO111MODULE=on go test -v ./pkg/...
  36. test-js:
  37. @echo "test frontend"
  38. yarn test
  39. test: test-go test-js
  40. run:
  41. @echo "start a server"
  42. ./bin/grafana-server
  43. clean:
  44. @echo "cleaning"
  45. rm -rf node_modules
  46. rm -rf public/build
  47. node_modules: package.json yarn.lock
  48. @echo "install frontend dependencies"
  49. yarn install --pure-lockfile --no-progress