dnsmasq/Makefile

36 lines
926 B
Makefile
Raw Normal View History

2023-04-13 15:03:08 +00:00
.PHONY: default build clean release require_clean_git
2023-04-13 12:45:03 +00:00
-include .env
VERSION=20230411
IMAGENAME=dnsmasq
REPO=docker.io/bardak
SHELL := /bin/bash
default: build
2023-04-13 15:03:08 +00:00
require_clean_git:
git update-index -q --ignore-submodules --refresh
git diff-files --quiet --ignore-submodules
git diff-index --cached --quiet --ignore-submodules HEAD --
@status=$$(git status --porcelain); \
if test "x$${status}" = x; then \
2023-04-13 15:06:25 +00:00
echo "No files"; \
2023-04-13 15:03:08 +00:00
else \
2023-04-13 15:06:25 +00:00
echo "Untracked files" >&2; \
2023-04-13 15:03:08 +00:00
fi
2023-04-13 12:45:03 +00:00
2023-04-13 15:06:25 +00:00
2023-04-13 12:45:03 +00:00
build:
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
2023-04-13 15:03:08 +00:00
clean:
2023-04-13 12:45:03 +00:00
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
2023-04-13 15:03:08 +00:00
release: require_clean_git build
2023-04-13 14:19:02 +00:00
$(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)