Scale down Kubernetes deployments after work hours
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.

33 lines
808 B

.PHONY: test docker push
IMAGE ?= hjacobs/kube-downscaler
VERSION ?= $(shell git describe --tags --always --dirty)
default: docker
.PHONY: install
poetry install
.PHONY: lint
lint: install
poetry run pre-commit run --all-files
test: lint install
poetry run coverage run --source=kube_downscaler -m py.test -v
poetry run coverage report
sed -i "s/version: v.*/version: v$(VERSION)/" deploy/*.yaml
sed -i "s/kube-downscaler:.*/kube-downscaler:$(VERSION)/" deploy/*.yaml
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"