infra: Change the ownership of stuff back to jenkins 83/21183/2
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Thu, 15 Sep 2016 13:47:09 +0000 (15:47 +0200)
committerMarkos Chandras <mchandras@suse.de>
Thu, 15 Sep 2016 13:58:35 +0000 (14:58 +0100)
Change-Id: I869a2e44b78ed33e3419077c32f5c0a08b63191f
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Signed-off-by: Markos Chandras <mchandras@suse.de>
jjb/infra/openstack-bifrost-verify.sh

index 42236f0..c17cb88 100755 (executable)
@@ -11,6 +11,16 @@ set -o errexit
 set -o nounset
 set -o pipefail
 
+trap fix_ownership EXIT
+
+function fix_ownership() {
+    if [ -z "${JOB_URL+x}" ]; then
+        echo "Not running as part of Jenkins. Handle the logs manually."
+    else
+        chown -R jenkins:jenkins $WORKSPACE
+    fi
+}
+
 # check distro to see if we support it
 # we will have centos and suse supported in future
 case "$DISTRO" in