X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fshell%2Frun_bluval.sh;h=c701b0fd18d10be8f7c1dfa757390723b9d79e20;hb=0646001ff141372c25dda0863f819b31ba40e409;hp=5f0c4dbdb4c06f22a11c392d3a5d923ebf19d401;hpb=2f004195aa71e593290d00152460d42e3ddefe36;p=ci-management.git diff --git a/jjb/shell/run_bluval.sh b/jjb/shell/run_bluval.sh index 5f0c4db..c701b0f 100755 --- a/jjb/shell/run_bluval.sh +++ b/jjb/shell/run_bluval.sh @@ -12,12 +12,21 @@ set -o errexit set -o pipefail cwd=$(pwd) +current_user=$(whoami) is_optional="false" info () { logger -s -t "run_blu_val.info" "$*" } +change_res_owner() { +# change owner of results created by root in container + if [ -d "$results_dir" ] + then + sudo chown -R "$current_user" "$results_dir" + fi +} + usage() { echo "usage: $0 -n " >&2 echo "[-r results dir">&2 @@ -134,5 +143,17 @@ if [ "$is_optional" == "true" ] || [ "$OPTIONAL" == "yes" ] then options+=" -o" fi + +set +e +# even if the script fails we need to change the owner of results # shellcheck disable=SC2086 python3 validation/bluval/blucon.py $options "$blueprint_name" + +if [ $? -ne 0 ]; then + change_res_owner + error "Bluval validation failed!" +fi + +set -e + +change_res_owner