Merge "Update Pharos Backup Job"
[releng.git] / jjb / daisy4nfv / daisy4nfv-download-artifact.sh
index 1cc0443..ae5ca38 100755 (executable)
@@ -57,12 +57,26 @@ fi
 
 # log info to console
 echo "Downloading the $INSTALLER_TYPE artifact using URL http://$OPNFV_ARTIFACT_URL"
-echo "This could take some time..."
+echo "This could take some time... Now the time is $(date -u)"
 echo "--------------------------------------------------------"
 echo
 
 # download the file
-curl -L -s -o $WORKSPACE/opnfv.bin http://$OPNFV_ARTIFACT_URL > gsutil.bin.log 2>&1
+if [[ "$NODE_NAME" =~ (zte) ]] && [ -x "$(command -v aria2c)" ]; then
+    DOWNLOAD_CMD="aria2c -x 3 --allow-overwrite=true -d $WORKSPACE -o opnfv.bin"
+else
+    DOWNLOAD_CMD="curl -L -s -o $WORKSPACE/opnfv.bin"
+fi
+
+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