I try to solve the following issue:
job("Docker | deploy") {
docker {
build {
context = "docker"
file = "./docker/Dockerfile"
labels["vendor"] = "mycompany"
args["HTTP_PROXY"] = "http://10.20.30.1:123"
}
push("registry.com") {
versionOne = Params("version-one")
versionTwo = Params("version-two")
tag = "${'$'}versionOne-${'$'}versionTwo"
}
}
}
Within the push
step, the tag should be combined of versionOne
and versionTwo
dynamically, but I don't figured it out how to achieve this.
Does someone know how to use variables dynamically in a space automation script?
The
docker
DSL is now deprecated. Instead, use the dockerBuildPush DSL in ahost
step (instead of adocker
/kaniko
step).Also, for regular project parameters (not secrets), you can use the
{{ project:<param> }}
template syntax instead of going through environment variables: