forked from hjacobs/kube-resource-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (24 loc) · 919 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
.PHONY: test docker push
IMAGE ?= hjacobs/kube-resource-report
VERSION ?= $(shell git describe --tags --always --dirty)
TAG ?= $(VERSION)
default: docker
test:
pipenv run flake8
pipenv run coverage run --source=kube_resource_report -m py.test
pipenv 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:
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
sed -i 's,tag: "[0-9.]*",tag: "$(VERSION)",g' chart/*/values.yaml
sed -i 's,appVersion: "[0-9.]*",appVersion: "$(VERSION)",g' chart/*/Chart.yaml
.PHONY: release
release: push version