Skip to content

Commit 3d23fb5

Browse files
Vlatombeolblak
andauthored
Update documentation w.r.t. ignoreUnsetValue: true (#2750)
* Update documentation w.r.t. `ignoreDefaultValue: true` updatecli/updatecli#7870 * Rename ignoreDefaultValue -> ignoreUnsetValue --------- Co-authored-by: Olivier Vernin <olivier@vernin.me>
1 parent 446ef82 commit 3d23fb5

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

content/en/docs/plugins/resource/dockerfile.adoc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Matches https://docs.docker.com/engine/reference/builder/#arg[Dockerfile ARG, wi
214214

215215
* When used as a target, *only* the value of the argument (right of the `=` when present)
216216
** When no argument value is found (e.g. default value, no character `=` or empty value),
217-
then updatecli appends the `=` character followed by the value.
217+
then updatecli appends the `=` character followed by the value. It is possible to disable this behaviour by providing `ignoreUnsetValue: true` in the configuration.
218218

219219
With the following definition:
220220

@@ -243,6 +243,34 @@ ARG RUST_VERSION=UPDATECLI_VERSION
243243
ARG updatecli_version
244244
----
245245

246+
Using `ignoreUnsetValue: true`, with the following definition:
247+
248+
[source, yaml]
249+
----
250+
spec:
251+
file: Dockerfile
252+
instruction:
253+
keyword: "ARG"
254+
matcher: "UPDATECLI_VERSION"
255+
ignoreUnsetValue: true
256+
----
257+
258+
you get the following results:
259+
260+
[source, Dockerfile]
261+
----
262+
# Matches
263+
ARG UPDATECLI_VERSION=0.1.0
264+
arg UPDATECLI_VERSION=0.1.0
265+
266+
## Does NOT matches
267+
ARG UPDATECLI_VERSION
268+
ARG UPDATECLI_VERSION=
269+
ARG GOLANG_VERSION
270+
ARG RUST_VERSION=UPDATECLI_VERSION
271+
ARG updatecli_version
272+
----
273+
246274
==== ENV
247275

248276
Matches https://docs.docker.com/engine/reference/builder/#env[Dockerfile ENV, window="_blank"] instruction by keys to manipulate their values.
@@ -257,7 +285,7 @@ Matches https://docs.docker.com/engine/reference/builder/#env[Dockerfile ENV, wi
257285

258286
* When used as a target, *only* the value of the environment (right of the `=` when present)
259287
** When no environment value is found (e.g. default value, no character `=` or empty value),
260-
then updatecli appends the `=` character followed by the value.
288+
then updatecli appends the `=` character followed by the value. It is possible to disable this behaviour by providing `ignoreUnsetValue: true` in the configuration.
261289

262290
With the following definition:
263291

0 commit comments

Comments
 (0)