Kubernetes Web View to list and view all Kubernetes resources https://kube-web-view.readthedocs.io/
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.

Makefile 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .PHONY: clean test appjs docker push mock
  2. IMAGE ?= hjacobs/kube-web-view
  3. GITDIFFHASH = $(shell git diff | md5sum | cut -c 1-4)
  4. VERSION ?= $(shell git describe --tags --always --dirty=-dirty-$(GITDIFFHASH))
  5. VERSIONPY = $(shell echo $(VERSION) | cut -d- -f 1)
  6. TAG ?= $(VERSION)
  7. TTYFLAGS = $(shell test -t 0 && echo "-it")
  8. OSNAME := $(shell uname | perl -ne 'print lc($$_)')
  9. default: docker
  10. .PHONY: poetry
  11. poetry:
  12. poetry install
  13. .PHONY: test
  14. test: poetry lint test.unit test.e2e
  15. .PHONY: lint
  16. lint:
  17. poetry run flake8
  18. poetry run black --check kube_web
  19. .PHONY: test.unit
  20. test.unit:
  21. poetry run coverage run --source=kube_web -m py.test tests/unit
  22. poetry run coverage report
  23. .PHONY: test.e2e
  24. test.e2e: docker
  25. env TEST_IMAGE=$(IMAGE):$(TAG) \
  26. poetry run pytest -v -r=a \
  27. --log-cli-level info \
  28. --log-cli-format '%(asctime)s %(levelname)s %(message)s' \
  29. --cluster-name kube-web-view-e2e \
  30. tests/e2e
  31. docker:
  32. docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
  33. @echo 'Docker image $(IMAGE):$(TAG) can now be used.'
  34. push: docker
  35. docker push "$(IMAGE):$(TAG)"
  36. docker tag "$(IMAGE):$(TAG)" "$(IMAGE):latest"
  37. docker push "$(IMAGE):latest"
  38. mock:
  39. docker run $(TTYFLAGS) -p 8080:8080 "$(IMAGE):$(TAG)" --mock
  40. .PHONY: docs
  41. docs:
  42. poetry run sphinx-build docs docs/_build
  43. .PHONY: run
  44. run:
  45. poetry run python3 -m kube_web --show-container-logs --debug "--object-links=ingresses=javascript:alert('{name}')" "--label-links=application=javascript:alert('Application label has value {label_value}')|eye|This is a link!" --preferred-api-versions=deployments=apps/v1
  46. .PHONY: run.kind
  47. run.kind:
  48. poetry run python3 -m kube_web --kubeconfig-path=$$(.pytest-kind/kube-web-view-e2e/kind get kubeconfig-path --name=kube-web-view-e2e) --debug --show-container-logs --search-default-resource-types=deployments,pods,configmaps --default-label-columns=pods=app "--default-hidden-columns=pods=Nominated Node" --exclude-namespaces=.*forbidden.*
  49. .PHONY: mirror
  50. mirror:
  51. git push --mirror git@github.com:hjacobs/kube-web-view.git
  52. .PHONY: version
  53. version:
  54. # poetry only accepts a narrow version format
  55. sed -i "s/^version = .*/version = \"${VERSIONPY}\"/" pyproject.toml
  56. sed -i "s/^version = .*/version = \"${VERSION}\"/" docs/conf.py
  57. sed -i "s/^__version__ = .*/__version__ = \"${VERSION}\"/" kube_web/__init__.py
  58. sed -i "s/v=[0-9A-Za-z._-]*/v=${VERSION}/g" kube_web/templates/base.html