From 3a8bff9b7ecaf2d6c6861838ab50845e0f2b60aa Mon Sep 17 00:00:00 2001 From: Zhijiang Hu Date: Thu, 11 Jan 2018 22:28:47 -0500 Subject: [daisy] Retry if download opnfv.bin failed 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 --- jjb/daisy4nfv/daisy4nfv-download-artifact.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'jjb/daisy4nfv') diff --git a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh index a64c80e5c..ae5ca3813 100755 --- a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh +++ b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh @@ -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 -- cgit 1.2.3-korg