Change owner of results folder and its files. 79/1979/2
authorvalentin.radulescu <valentin.radulescu@enea.com>
Thu, 14 Nov 2019 11:58:53 +0000 (03:58 -0800)
committervalentin.radulescu <valentin.radulescu@enea.com>
Fri, 15 Nov 2019 15:01:26 +0000 (07:01 -0800)
JIRA: VAL-88

The files in results folder are created by root in container.

Signed-off-by: valentin.radulescu <valentin.radulescu@enea.com>
Change-Id: I9d7b9450c6ae379a8f41492d84f037e3557ef032

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