2020-12-02 02:38:02 +01:00
|
|
|
dcmd = docker
|
2022-04-20 16:29:25 +02:00
|
|
|
dfile = Containerfile
|
2020-12-02 02:38:02 +01:00
|
|
|
dtag = immawanderer/fedora-hugo:testbuild
|
2020-12-29 01:56:39 +01:00
|
|
|
dargs = build -t $(dtag) --no-cache --pull - < $(dfile)
|
2020-12-02 02:38:02 +01:00
|
|
|
cleanargs = image rm -f $(dtag)
|
2020-12-02 03:45:36 +01:00
|
|
|
pruneargs = system prune -af
|
2022-04-28 14:02:30 +02:00
|
|
|
dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir):z
|
2022-04-28 14:04:41 +02:00
|
|
|
kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.8.1-debug
|
2020-12-02 02:38:02 +01:00
|
|
|
kanikowdir = /src
|
|
|
|
kanikocontext = .
|
2021-10-21 01:12:20 +02:00
|
|
|
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")
|
2020-12-02 02:38:02 +01:00
|
|
|
|
2020-12-29 01:59:37 +01:00
|
|
|
.PHONY: build kaniko clean test prune
|
2020-12-02 02:38:02 +01:00
|
|
|
|
|
|
|
kaniko:
|
|
|
|
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)
|
|
|
|
|
|
|
|
build:
|
|
|
|
$(dcmd) $(dargs)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(dcmd) $(cleanargs)
|
|
|
|
|
2020-12-29 01:59:37 +01:00
|
|
|
test: build kaniko
|
|
|
|
|
2020-12-02 02:38:02 +01:00
|
|
|
prune:
|
|
|
|
$(dcmd) $(pruneargs)
|