From: Guillaume Abrioux Date: Thu, 24 Jan 2019 15:20:48 +0000 (+0100) Subject: ceph_ansible: check if tox env is defined X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1239%2Fhead;p=ceph-build.git ceph_ansible: check if tox env is defined tox allows to run even if an env doesn't match all the factors in the full name. This commits check that the desired environment is well defined in envlist. Signed-off-by: Guillaume Abrioux --- diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index c464c149..de9c33b1 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -750,10 +750,21 @@ function build_job_name() { echo "${job_name}" } +# shellcheck disable=SC2153 +ENV_NAME="$(build_job_name "$RELEASE" "$DISTRIBUTION" "$DEPLOYMENT" "$SCENARIO")" + +for tox_env in $("$VENV"/tox -l) +do + if [[ "$ENV_NAME" == "$tox_env" ]]; then # shellcheck disable=SC2116 -if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox --workdir="$TEMPVENV" -v -e="$(build_job_name $RELEASE $DISTRIBUTION $DEPLOYMENT $SCENARIO)" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." - exit 1 -fi + if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox --workdir="$TEMPVENV" -v -e="$ENV_NAME" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." + exit 1 + fi + return 0 + fi +done +echo "ERROR: Environment $ENV_NAME is not defined in tox.ini!" +exit 1 } github_status_setup() {