summaryrefslogtreecommitdiff
path: root/tools/ci/scripts/dockerretry.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-01-25 03:38:03 +0300
committerAndrei Karas <akaras@inbox.ru>2017-01-25 17:55:02 +0300
commit95abdee4ee3b29b500a1b285c1745d7f5acf799c (patch)
tree75c2dbca4560d62432566e84868fe3d1f221d218 /tools/ci/scripts/dockerretry.sh
parent166fdffd04277c5f29f57ace70a16d34e49c7bb0 (diff)
downloadmanaverse-95abdee4ee3b29b500a1b285c1745d7f5acf799c.tar.gz
manaverse-95abdee4ee3b29b500a1b285c1745d7f5acf799c.tar.bz2
manaverse-95abdee4ee3b29b500a1b285c1745d7f5acf799c.tar.xz
manaverse-95abdee4ee3b29b500a1b285c1745d7f5acf799c.zip
In ci move install packages from shell scripts into .gitlab-ci.yml
Diffstat (limited to 'tools/ci/scripts/dockerretry.sh')
-rwxr-xr-xtools/ci/scripts/dockerretry.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/ci/scripts/dockerretry.sh b/tools/ci/scripts/dockerretry.sh
new file mode 100755
index 000000000..22e38e574
--- /dev/null
+++ b/tools/ci/scripts/dockerretry.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# skip if we not in docker
+if [[ ${CI_RUNNER_TAGS} != *"docker"* ]]; then
+ echo "Running from shell. Skipping $*"
+ exit 0
+fi
+
+n=0
+
+while true; do
+ $*
+ if [ "$?" == 0 ]; then
+ exit 0
+ fi
+ if [[ $n -ge 10 ]]; then
+ exit -1
+ fi
+ sleep 5s
+ n=$((n+1))
+done