Change owner of results folder and its files.
[ci-management.git] / jjb / shell / run_bluval.sh
index 5f0c4db..5870ed9 100755 (executable)
@@ -14,6 +14,12 @@ set -o pipefail
 cwd=$(pwd)
 is_optional="false"
 
+finish() {
+    # Fix ownership of output files
+    user_id=$(stat -c '%u:%g' $cwd)
+    sudo chown -R ${user_id} $results_dir
+}
+
 info ()  {
     logger -s -t "run_blu_val.info" "$*"
 }
@@ -112,6 +118,8 @@ then
     fi
 fi
 
+trap finish EXIT
+
 if [ ! -d "$cwd/validation" ]
 then
     git clone http://gerrit.akraino.org/r/validation