Download from http://build.opnfv.org/artifacts.opnfv.org may fail [1]
so we need retry to make CI stable.
[1] https://build.opnfv.org/ci/job/daisy-deploy-baremetal-daily-master/374/console
Change-Id: I62837038c7f124870814a68e4b87a8e89ba8c58c
Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
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