Install yq on demand in updateHelmTag (missing from docker:27-cli)
Build #11 failed: "yq: not found". docker:27-cli's Alpine base doesn't ship yq by default, same gap as the bash/python3 on-demand installs already in runHooks.groovy. Alpine renamed the mikefarah/yq package from `yq` to `yq-go` at v3.20 (and an unrelated Python-based tool is also sometimes packaged as plain `yq` on other distros, with incompatible syntax) — tries yq-go first, falls back to yq, rather than assume which Alpine version docker:27-cli currently ships.
This commit is contained in:
@@ -43,6 +43,14 @@ def run(Map config) {
|
||||
def authedUrl = "${urlParts[0]}://\${GIT_USER}:\${GIT_PASS}@${urlParts[1]}"
|
||||
sh """
|
||||
git clone ${authedUrl} .
|
||||
# docker:27-cli's Alpine base doesn't ship yq by
|
||||
# default. Package name is 'yq-go' on Alpine >= 3.20,
|
||||
# plain 'yq' on older Alpine (both are mikefarah/yq,
|
||||
# the Go tool this -i/path-expression syntax assumes
|
||||
# — a same-named 'yq' package on some distros is a
|
||||
# completely different, Python-based tool). Try both
|
||||
# rather than guess which Alpine base is current.
|
||||
apk add --no-cache yq-go 2>/dev/null || apk add --no-cache yq
|
||||
yq -i '${config.image_tag_yq_path} = "${env.TAG}"' ${valuesFile}
|
||||
git config user.email 'jenkins-ci@homelab.local'
|
||||
git config user.name 'jenkins-ci'
|
||||
|
||||
Reference in New Issue
Block a user