From b5feb842e78cb85e2282c38f07b75fed07997957 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Jun 2016 18:11:11 +0300 Subject: Add support for local mirror if running in local runner. --- tools/ci/scripts/init.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tools') diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index 2edc758..d641cdf 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -15,6 +15,22 @@ function do_init { ln -s evol-hercules server-plugin } +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 { echo "apt-get update" apt-get update @@ -151,4 +167,5 @@ function build_init { check_error $? } +update_repos aptget_update -- cgit v1.2.3-60-g2f50