26 lines
543 B
Makefile
26 lines
543 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)" ]; then echo "git repo not clean"; exit 1; fi
|
||
|
|
||
|
build:
|
||
|
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
|
||
|
|
||
|
clean:
|
||
|
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
|
||
|
|
||
|
release: guard clean build
|
||
|
git tag v$(VERSION)
|
||
|
git push origin v$(VERSION)
|
||
|
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
|