2023-04-13 12:45:03 +00:00
|
|
|
.PHONY: default build clean release
|
|
|
|
|
|
|
|
-include .env
|
|
|
|
|
|
|
|
VERSION=20230411
|
|
|
|
IMAGENAME=dnsmasq
|
|
|
|
REPO=docker.io/bardak
|
|
|
|
|
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
default: build
|
|
|
|
|
|
|
|
guard:
|
2023-04-13 14:46:12 +00:00
|
|
|
@ if [ -z "$(git status --porcelain=v1 2>/dev/null)" ]; then echo "git not clean!"; exit 1; fi
|
2023-04-13 12:45:03 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
|
|
|
|
|
2023-04-13 14:46:12 +00:00
|
|
|
clean: guard
|
2023-04-13 12:45:03 +00:00
|
|
|
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
|
|
|
|
|
2023-04-13 14:19:02 +00:00
|
|
|
release: guard build
|
|
|
|
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/sbin/dnsmasq --version))
|
|
|
|
git tag -a v$(VERSION) -m "${TMP_MESSAGE}"
|
2023-04-13 12:45:03 +00:00
|
|
|
git push origin v$(VERSION)
|
|
|
|
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
|