Commit 9eb7d002 authored by Emeric Verschuur's avatar Emeric Verschuur

[ci-toolbox] Simplify the code for parsing YAML values. Make a error message more detailed

parent 0efc306b
......@@ -154,12 +154,9 @@ citbx_gitlab_ci_variables() {
for k in $(citbx_gitlab_ci_query -r "$node | keys[]"); do
if ! [[ "$(citbx_gitlab_ci_query -r "${node}.$k | type")" =~ ^(string|number)$ ]]; then
print_critical "Invalid $node variable (type=$(citbx_gitlab_ci_query -r "${node}.$k | type"): $k)"
print_critical "Invalid $node variable (type=$(citbx_gitlab_ci_query -r "${node}.$k | type"): $k). Only strings and numbers are supported."
eval "$k=$(citbx_gitlab_ci_query "${node}.$k")"
declare | grep "^$k=" | sed -E 's/^[^=]+=//g'
value="$(citbx_gitlab_ci_query "${node}.$k")"
eval "$k=$value"
CITBX_DOCKER_RUN_ARGS+=(-e "$(eval "echo $k=$value")")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment