forked from hjacobs/kube-resource-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 896 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.PHONY: test docker push
IMAGE ?= hjacobs/kube-resource-report
VERSION ?= $(shell git describe --tags --always --dirty)
TAG ?= $(VERSION)
default: docker
.PHONY:
install:
poetry install
.PHONY:
lint: install
poetry run pre-commit run --all-files
.PHONY:
test: install lint
poetry run coverage run --source=kube_resource_report -m py.test
poetry run coverage report
docker:
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
@echo 'Docker image $(IMAGE):$(TAG) can now be used.'
push: docker
docker push "$(IMAGE):$(TAG)"
docker tag "$(IMAGE):$(TAG)" "$(IMAGE):latest"
docker push "$(IMAGE):latest"
.PHONY: version
version:
poetry version $(VERSION)
sed -i 's,$(IMAGE):[0-9.]*,$(IMAGE):$(TAG),g' README.rst deploy/*.yaml
sed -i 's,version: v[0-9.]*,version: v$(VERSION),g' deploy/*.yaml
.PHONY: release
release: push version