diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-06-22 20:55:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-06-22 20:55:20 +0300 |
commit | ec89e68a38cb5efc4c7f7a01d640441ec17c045f (patch) | |
tree | 7b98aa603d14cced9dc7afb65e02a630ae811312 /.tools/init.sh | |
parent | b4faf8c58e65af282b83b71157b2298d6d006bc5 (diff) | |
download | clientdata-ec89e68a38cb5efc4c7f7a01d640441ec17c045f.tar.gz clientdata-ec89e68a38cb5efc4c7f7a01d640441ec17c045f.tar.bz2 clientdata-ec89e68a38cb5efc4c7f7a01d640441ec17c045f.tar.xz clientdata-ec89e68a38cb5efc4c7f7a01d640441ec17c045f.zip |
In ci scripts try to clone first from fork and after from original repos.
Diffstat (limited to '.tools/init.sh')
-rwxr-xr-x | .tools/init.sh | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/.tools/init.sh b/.tools/init.sh index 18e8dac7..7e57a76f 100755 --- a/.tools/init.sh +++ b/.tools/init.sh @@ -7,14 +7,33 @@ function check_error { fi } +function gitclone1 { + echo git clone $2 $3 + git clone $2 $3 + if [ "$?" != 0 ]; then + echo git clone $1 $3 + git clone $1 $3 + return $? + fi + return $? +} + function gitclone { - git clone $* + export name1=$1/$2 + export name2=${CI_BUILD_REPO##*@} + export name2=https://${name2%/*}/$2 + + gitclone1 $1 $2 $3 if [ "$?" != 0 ]; then sleep 1s - git clone $* + gitclone1 $1 $2 $3 if [ "$?" != 0 ]; then sleep 3s - git clone $* + gitclone1 $1 $2 $3 + if [ "$?" != 0 ]; then + sleep 5s + gitclone1 $1 $2 $3 + fi fi fi check_error $? |