Merge "xci: Add/update variables to tool, user, and flavors"
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Tue, 28 Mar 2017 14:32:33 +0000 (14:32 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 28 Mar 2017 14:32:33 +0000 (14:32 +0000)
jjb/dovetail/dovetail-run.sh
jjb/xci/bifrost-cleanup-job.yml

index f9a3df6..4b00ec8 100755 (executable)
@@ -85,9 +85,11 @@ echo "Container exec command: ${run_cmd}"
 docker exec $container_id ${run_cmd}
 
 sudo cp -r ${DOVETAIL_REPO_DIR}/results ./
-#To make sure the file owner is jenkins, for the copied results files in the above line
+#To make sure the file owner is the current user, for the copied results files in the above line
 #if not, there will be error when next time to wipe workspace
-sudo chown -R jenkins:jenkins ${WORKSPACE}/results
+CURRENT_USER=${SUDO_USER:-$USER}
+PRIMARY_GROUP=$(id -gn $CURRENT_USER)
+sudo chown -R ${CURRENT_USER}:${PRIMARY_GROUP} ${WORKSPACE}/results
 
 echo "Dovetail: done!"
 
index 4e9e2a8..d4b2157 100644 (file)
                 echo "gsutil will not be executed until this is fixed!"
                 exit 1
             fi
-            # No force (-f). We always verify upstream jobs so if there are no logs
-            # something else went wrong and we need to break immediately and investigate
-            gsutil -m rm -r $BIFROST_GS_URL
+            try_to_rm=1
+            while [[ $try_to_rm -lt 6 ]]; do
+                gsutil -m rm -r $BIFROST_GS_URL && _exitcode=$? && break
+                _exitcode=$?
+                echo "gsutil rm failed! Trying again... (attempt #$i)"
+                let try_to_rm += 1
+                # Give it some time...
+                sleep 10
+            done
+            exit $_exitcode
 
     triggers:
         - '{project}-gerrit-trigger-cleanup':