diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-06-13 20:05:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-06-13 20:05:08 +0300 |
commit | 1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1 (patch) | |
tree | 528721dd75f90132be28f2c4908565be84423c72 /.tools | |
parent | 8fa9a4e750b5e928528d1aa7b4b41df465f10fab (diff) | |
download | clientdata-1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1.tar.gz clientdata-1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1.tar.bz2 clientdata-1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1.tar.xz clientdata-1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1.zip |
Use local mirror if ci running inside local runner.
Diffstat (limited to '.tools')
-rwxr-xr-x | .tools/init.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.tools/init.sh b/.tools/init.sh index 99f85e70..18e8dac7 100755 --- a/.tools/init.sh +++ b/.tools/init.sh @@ -20,7 +20,24 @@ function gitclone { check_error $? } +function update_repos { + if [ "$CI_SERVER" == "" ]; + then + return + fi + + export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101") + if [ "$DATA" != "" ]; + then + echo "Detected local runner" + sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list + else + echo "Detected non local runner" + fi +} + function aptget_update { + update_repos apt-get update if [ "$?" != 0 ]; then sleep 1s |