Report Kubernetes cluster and pod resource requests vs usage and generate static HTML
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
896 B

  1. .PHONY: test docker push
  2. IMAGE ?= hjacobs/kube-resource-report
  3. VERSION ?= $(shell git describe --tags --always --dirty)
  4. TAG ?= $(VERSION)
  5. default: docker
  6. .PHONY:
  7. install:
  8. poetry install
  9. .PHONY:
  10. lint: install
  11. poetry run pre-commit run --all-files
  12. .PHONY:
  13. test: install lint
  14. poetry run coverage run --source=kube_resource_report -m py.test
  15. poetry run coverage report
  16. docker:
  17. docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
  18. @echo 'Docker image $(IMAGE):$(TAG) can now be used.'
  19. push: docker
  20. docker push "$(IMAGE):$(TAG)"
  21. docker tag "$(IMAGE):$(TAG)" "$(IMAGE):latest"
  22. docker push "$(IMAGE):latest"
  23. .PHONY: version
  24. version:
  25. poetry version $(VERSION)
  26. sed -i 's,$(IMAGE):[0-9.]*,$(IMAGE):$(TAG),g' README.rst deploy/*.yaml
  27. sed -i 's,version: v[0-9.]*,version: v$(VERSION),g' deploy/*.yaml
  28. .PHONY: release
  29. release: push version