From 1bebb4179427c25dae9b9cbc74fd33d5ca5ef9c1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Jun 2016 20:05:08 +0300 Subject: Use local mirror if ci running inside local runner. --- .tools/init.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to '.tools') 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 -- cgit v1.2.3-60-g2f50