7 Commits

Author SHA1 Message Date
Jonas Forsberg
5d4eb1922d forgot \ 2023-04-13 17:09:44 +02:00
Jonas Forsberg
e59099570c forgot ; 2023-04-13 17:08:54 +02:00
Jonas Forsberg
49116b883b I cross my fingers... 2023-04-13 17:08:14 +02:00
Jonas Forsberg
98e5ebf825 yet another try 2023-04-13 17:06:25 +02:00
Jonas Forsberg
e75ec99fcd another try on clean git 2023-04-13 17:03:08 +02:00
Jonas Forsberg
5be3153522 yet another guard try 2023-04-13 16:46:12 +02:00
Jonas Forsberg
3e8c266ae0 fixed guard 2023-04-13 16:41:58 +02:00

View File

@@ -1,4 +1,4 @@
.PHONY: default build clean release
.PHONY: default build clean release require_clean_git
-include .env
@@ -10,8 +10,18 @@ SHELL := /bin/bash
default: build
guard:
@ if [ -z "$(git status --porcelain)" ]; then echo "git repo not clean"; exit 1; fi
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 \
echo "No untracked files detected"; \
else \
echo "Untracked files detected" >&2; \
exit 1; \
fi
build:
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
@@ -19,7 +29,7 @@ build:
clean:
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
release: guard build
release: require_clean_git 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)