Merge "[daisy] Retry if download opnfv.bin failed"
authorAric Gardner <agardner@linuxfoundation.org>
Fri, 12 Jan 2018 19:59:19 +0000 (19:59 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 12 Jan 2018 19:59:19 +0000 (19:59 +0000)
jjb/daisy4nfv/daisy4nfv-download-artifact.sh

index a64c80e..ae5ca38 100755 (executable)
@@ -68,7 +68,15 @@ else
     DOWNLOAD_CMD="curl -L -s -o $WORKSPACE/opnfv.bin"
 fi
 
-$DOWNLOAD_CMD http://$OPNFV_ARTIFACT_URL > gsutil.bin.log 2>&1
+maxretries=3
+cnt=0
+rc=1
+while [ $cnt -lt $maxretries ] && [ $rc -ne 0 ]
+do
+    cnt=$[cnt + 1]
+    $DOWNLOAD_CMD http://$OPNFV_ARTIFACT_URL > gsutil.bin.log 2>&1
+    rc=$?
+done
 
 # list the file
 ls -al $WORKSPACE/opnfv.bin