Gitlab CI: command to retry git clone in case of network failure

This commit is contained in:
Rohit Gupta
2016-08-14 12:03:00 +02:00
parent 47e0589aaf
commit d2d8290752
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
#Simple script to retry git clone in case of failure
REALGIT=/usr/bin/git
RETRIES=10
DELAY=10
COUNT=1
while [ $COUNT -lt $RETRIES ]; do
$REALGIT $*
if [ $? -eq 0 ]; then
RETRIES=0
break
fi
let COUNT=$COUNT+1
sleep $DELAY
done