From 04ec1f51d8a8668d89db48790784f28f141f1459 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Wed, 12 Apr 2023 17:02:55 +0200 Subject: [PATCH] added guard --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3060399..1aa59a4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: default build +.PHONY: default build clean -include .env @@ -6,10 +6,16 @@ VERSION=0.15.1-1.2 SHELL := /bin/bash +guard: + @ if [ -z "$(git status --porcelain)" ]; then echo "git repo not clean"; exit 1; fi + default: build build: podman build --build-arg VERSION=$(VERSION) --tag docker.io/bardak/restic:$(VERSION) . -push: +clean: + podman image rm docker.io/bardak/restic:$(VERSION) + +push: guard build podman push --creds $(USERNAME):$(PASSWORD) docker.io/bardak/restic:$(VERSION)