aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/functions
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-10-18 09:29:55 -0700
committerVictor Morales <victor.morales@intel.com>2017-10-18 09:36:23 -0700
commitcf26999de441d3e915ee011ddfa31a2bb1b1af15 (patch)
tree388c8623330539f0572088506d3692d1f83d48a4 /bootstrap/vagrant-onap/lib/functions
parent69cd717348e635d1a55689b22873b751cc5ff2b1 (diff)
Fix proxy usage for docker external
The process that retrieves Docker images hosted externally was missing a step in its configuration. This change fix the configuration and unblock the pending Unit Tests. Change-Id: I5a6b39086eb806bab5bb2667092a154e230d33ef Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: INT-227
Diffstat (limited to 'bootstrap/vagrant-onap/lib/functions')
-rwxr-xr-xbootstrap/vagrant-onap/lib/functions20
1 files changed, 14 insertions, 6 deletions
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions
index 8fff0c2c4..02111fa2c 100755
--- a/bootstrap/vagrant-onap/lib/functions
+++ b/bootstrap/vagrant-onap/lib/functions
@@ -100,23 +100,31 @@ function install_maven {
# _configure_docker_settings() - Configures Docker settings
function _configure_docker_settings {
+ local docker_conf_backup=/tmp/docker.backup
+ local docker_conf=/etc/default/docker
+ local chameleonsocks_filename=chameleonsocks.sh
+
+ cp $docker_conf $docker_conf_backup
if [ $http_proxy ]; then
- echo "export http_proxy=$http_proxy" >> /etc/default/docker
+ echo "export http_proxy=$http_proxy" >> $docker_conf
fi
if [ $https_proxy ]; then
- echo "export https_proxy=$https_proxy" >> /etc/default/docker
+ echo "export https_proxy=$https_proxy" >> $docker_conf
#If you have a socks proxy, then use that to connect to the nexus repo
#via a redsocks container
if [ $socks_proxy ]; then
- wget https://raw.githubusercontent.com/crops/chameleonsocks/master/chameleonsocks.sh
- chmod 755 chameleonsocks.sh
+ wget https://raw.githubusercontent.com/crops/chameleonsocks/master/$chameleonsocks_filename
+ chmod 755 $chameleonsocks_filename
socks=$(echo $socks_proxy | sed -e "s/^.*\///" | sed -e "s/:.*$//")
port=$(echo $socks_proxy | sed -e "s/^.*://")
- PROXY=$socks PORT=$port ./chameleonsocks.sh --install
+ PROXY=$socks PORT=$port ./$chameleonsocks_filename --install
+ rm $chameleonsocks_filename
+ cp $docker_conf_backup $docker_conf
fi
fi
+ rm $docker_conf_backup
- echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> /etc/default/docker
+ echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> $docker_conf
usermod -a -G docker vagrant
}