From 4fb893fcf8ef55ff3ebbdf684c4d1cfab913cea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Fri, 29 Dec 2017 10:22:08 +0200 Subject: Set up proxy for provisioning scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTQAINFRA-1669 Change-Id: I582dc5037bd2b46dcd5c9c3b2cb13784e122d6a5 Reviewed-by: Simo Fält --- .../qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh') diff --git a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh index e541d83b..b44c3014 100755 --- a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh +++ b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh @@ -40,6 +40,7 @@ set -ex source "${BASH_SOURCE%/*}/../common/try_catch.sh" +source "${BASH_SOURCE%/*}/../common/check_and_set_proxy.sh" NTS_IP=10.212.2.216 @@ -47,6 +48,7 @@ ExceptionGsettings1=100 ExceptionGsettings2=101 ExceptionGsettings3=102 ExceptionNTS=103 +ExceptionProxy=104 try ( @@ -59,6 +61,10 @@ try echo "Set Network Test Server address to $NTS_IP in /etc/hosts" echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts || throw $ExceptionNTS + + if [ "$proxy" != "" ]; then + echo "Acquire::http::Proxy \"$proxy\";" | sudo tee -a /etc/apt/apt.conf || throw $ExceptionProxy + fi ) catch || { case $ex_code in @@ -78,6 +84,10 @@ catch || { echo "Failed to set network teset server address into /etc/hosts." exit 1; ;; + $ExceptionProxy) + echo "Failed to set proxy /etc/apt/apt.conf." + exit 1; + ;; esac } -- cgit v1.2.3