fix(kaniko): supply build args {in ci,locally}
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-10-21 01:12:20 +02:00
parent 8c2b65c4cd
commit af99fa3f7c
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 9 additions and 1 deletions

@ -29,6 +29,9 @@ steps:
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
context: . context: .
args:
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
when: when:
ref: ref:
- "refs/heads/feature-**" - "refs/heads/feature-**"
@ -43,6 +46,9 @@ steps:
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
context: . context: .
args:
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
tags: tags:
- latest - latest
- linux-amd64 - linux-amd64

@ -8,7 +8,9 @@ dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir)
kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.7.0-debug kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.7.0-debug
kanikowdir = /src kanikowdir = /src
kanikocontext = . kanikocontext = .
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push 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")
.PHONY: build kaniko clean test prune .PHONY: build kaniko clean test prune