Commit e948be19 authored by Emeric Verschuur's avatar Emeric Verschuur

[FIX] Eval YAML service properties

parent b39e9997
......@@ -35,7 +35,7 @@ job-advanced:
- tools/gitlab-ci/run.sh
job-with-volumes:
image: registry.gitlab.com/ercom/cijw4gitlab:2.1
image: registry.gitlab.com/ercom/cijw4gitlab:2.0.1
stage: build
only:
- /^$/
......@@ -62,7 +62,7 @@ job-test-services:
- "true"
job-test-services-ext:
image: registry.gitlab.com/ercom/cijw4gitlab:2.1
image: registry.gitlab.com/ercom/cijw4gitlab:2.0.1
stage: build
variables:
MYSQL_DATABASE: test
......
......@@ -686,25 +686,25 @@ case "$CITBX_JOB_EXECUTOR" in
object)
# Read the service name/image property
if [ "$(gitlab_ci_query -r "$p.services[$s].name | type")" == "string" ]; then
service_image=$(gitlab_ci_query -r "$p.services[$s].name")
service_image="$(eval echo "$(gitlab_ci_query "$p.services[$s].name")")"
else
print_critical "$s: property 'name' not found"
fi
# Read entrypoint property
if [ "$(gitlab_ci_query -r "$p.services[$s].entrypoint | type")" == "array" ]; then
for i in $(seq 0 $(gitlab_ci_query -r "$p.services[$s].entrypoint | length - 1")); do
service_commands+=("$(gitlab_ci_query -r "$p.services[$s].entrypoint[$i]")")
service_commands+=("$(eval echo "$(gitlab_ci_query "$p.services[$s].entrypoint[$i]")")")
done
fi
# Read command property
if [ "$(gitlab_ci_query -r "$p.services[$s].command | type")" == "array" ]; then
for i in $(seq 0 $(gitlab_ci_query -r "$p.services[$s].command | length - 1")); do
service_commands+=("$(gitlab_ci_query -r "$p.services[$s].command[$i]")")
service_commands+=("$(eval echo "$(gitlab_ci_query "$p.services[$s].command[$i]")")")
done
fi
# Read service alias property
if [ "$(gitlab_ci_query -r "$p.services[$s].alias | type")" == "string" ]; then
service_alias="$(gitlab_ci_query -r "$p.services[$s].alias")"
service_alias="$(eval echo "$(gitlab_ci_query "$p.services[$s].alias")")"
else
service_alias="$(echo "$service_image" | sed -E 's/:[^:\/]+//g' | sed -E 's/[^a-zA-Z0-9\._-]/__/g')"
fi
......@@ -712,7 +712,7 @@ case "$CITBX_JOB_EXECUTOR" in
start_docker_service "$service_image" "$service_alias" "${service_commands[@]}"
;;
string)
service_image=$(gitlab_ci_query -r "$p.services[$s]")
service_image="$(eval echo "$(gitlab_ci_query "$p.services[$s]")")"
# Start service
start_docker_service "$service_image" "$(echo "$service_image" | sed -E 's/:[^:\/]+//g' | sed -E 's/[^a-zA-Z0-9\._-]/__/g')"
;;
......
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