add makefile + .hadolint.yaml for local testing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-03-24 16:59:04 +01:00
parent 30c651c763
commit d1455a97cf
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 37 additions and 0 deletions

2
.hadolint.yaml Normal file

@ -0,0 +1,2 @@
---
ignored:

35
Makefile Normal file

@ -0,0 +1,35 @@
dcmd = docker
dfile = Dockerfile
dtag = immawanderer/archlinux-cdev: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:v1.8.0-debug
kanikowdir = /src
kanikocontext = .
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --build-arg BUILD_DATE=$(build_date) --build-arg VCS_REF=$(vcs_ref) --no-push
vcs_ref = $$(git rev-parse --short HEAD)
build_date= $$(date -u +"%Y-%m-%dT%H:%M:%SZ")
hadolintimg = hadolint/hadolint
hadolinttag = v2.9.3-alpine
hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml
.PHONY: hadolint build kaniko clean test prune
hadolint:
$(dcmd) $(hadolintargs) $(hadolintimg):$(hadolinttag) < $(dfile)
kaniko:
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)
build:
$(dcmd) $(dargs)
clean:
$(dcmd) $(cleanargs)
test: hadolint build kaniko
prune:
$(dcmd) $(pruneargs)