27 lines
690 B
Makefile
27 lines
690 B
Makefile
.PHONY: default build clean release
|
|
|
|
-include .env
|
|
|
|
VERSION=20230411
|
|
IMAGENAME=dnsmasq
|
|
REPO=docker.io/bardak
|
|
|
|
SHELL := /bin/bash
|
|
|
|
default: build
|
|
|
|
guard:
|
|
@ if [ -z "$(git status --porcelain=v1 2>/dev/null)" ]; then echo "git not clean!"; exit 1; fi
|
|
|
|
build:
|
|
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
|
|
|
|
clean: guard
|
|
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
|
|
|
|
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}"
|
|
git push origin v$(VERSION)
|
|
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
|