summaryrefslogtreecommitdiff
path: root/ci/ciimage/common.sh
blob: c8940df6dc130bb98828b031641ef98cc4e6fdbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

###
### Common functions for CI builder files.
### All functions can be accessed in install.sh via:
###
### $ source /ci/common.sh
###

set -e

dub_fetch() {
  set +e
  for (( i=1; i<=24; ++i )); do
    dub fetch "$@"
    (( $? == 0 )) && break

    echo "Dub Fetch failed. Retrying in $((i*5))s"
    sleep $((i*5))
  done
  set -e
}