From 01c9a0fbc46b3ba3e1285acd70fdcea45051e644 Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 30 Sep 2021 13:15:26 +0200 Subject: [PATCH] add Makefile for easy local testing --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..269f469 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +dcmd = docker +dfile = Dockerfile +dtag = immawanderer/archlinux:testbuild +dargs = build -t $(dtag) --no-cache --pull - < $(dfile) +cleanargs = image rm -f $(dtag) +pruneargs = system prune -af +dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir) +kanikoexecutorimg = gcr.io/kaniko-project/executor@sha256:6ecc43ae139ad8cfa11604b592aaedddcabff8cef469eda303f1fb5afe5e3034 +kanikowdir = /src +kanikocontext = . +kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push +hadolintimg = hadolint/hadolint:v2.7.0-alpine +hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml + +.PHONY: hadolint build kaniko clean test prune + +hadolint: + $(dcmd) $(hadolintargs) $(hadolintimg) < $(dfile) + +kaniko: + $(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs) + +build: + $(dcmd) $(dargs) + +clean: + $(dcmd) $(cleanargs) + +test: hadolint build kaniko + +prune: + $(dcmd) $(pruneargs)