diff options
author | Stefan K. Berg <stefan.k.berg@ericsson.com> | 2015-10-19 16:52:34 +0200 |
---|---|---|
committer | Stefan K. Berg <stefan.k.berg@ericsson.com> | 2015-10-26 16:24:10 +0100 |
commit | 0635291a88dd006e15224169524a7fc761ad47ab (patch) | |
tree | 05109743abecf67648fccd8ac3ce06029520828d /fuel/build/f_isoroot/f_repobuild/Makefile | |
parent | a890c03a1bf0ebdd19cf8c2dfdf3bc19a2391fc7 (diff) |
Support for building Fuel behind a http proxy
The build system is now able to work also behind a traditional web
proxy setup if the http_proxy, https_proxy and (if needed) no_proxy
environment variables has been set prior to invoking make.
This is a joint work by Gillian Dunne <gillian.dunne@intel.com> and
Stefan Berg <stefan.k.berg@ericsson.com>.
Verification so far has been with a mock setup, placing the build
machine behind a Squid proxy and blocking outgoing traffic not going
through the proxy by firewall rules. The following environment
variables was set in the host for these tests:
RSYNC_PROXY=10.0.0.1:8888
http_proxy=http://10.0.0.1:8888
https_proxy=http://10.0.0.1:8888
no_proxy=localhost,127.0.0.1,.consultron.com,.sock
*** IMPORTANT NOTE ABOUT THE HOST PROXY SETTINGS ***
The build system will make use the following proxy environment
variables:
http_proxy:
https_proxy
no_proxy
RSYNC_PROXY
RSYNC_CONNECT_PROG
During the build phase, a local Ubuntu package repository is fetched
from upstream in order to be added to the OPNFV Fuel ISO and for parts
of this process rsync is used.
This will require that either RSYNC_PROXY is set according to the
format "<proxy host>:<proxy port>" and that the proxy indicated indeed
allows rsync traffic *or* that RSYNC_CONNECT_PROG is set to use an
alternative transport. For a detailed explanation of these settings,
see the rsync manual page.
*** IMPORTANT NOTE ABOUT THE HOST DOCKER DAEMON SETTINGS ***
The Docker daemon on the host must be configured to use the http proxy
for it to be able to pull the base Ubuntu 14.04 image from the Docker
registry before invoking make! In Ubuntu this is done by adding a line
like:
export http_proxy="http://10.0.0.1:8888/"
to /etc/default/docker and restarting the Docker daemon.
Change-Id: Ieed2269af295d90a4b33d834f723889bdf9c7dc6
Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
Diffstat (limited to 'fuel/build/f_isoroot/f_repobuild/Makefile')
-rw-r--r-- | fuel/build/f_isoroot/f_repobuild/Makefile | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fuel/build/f_isoroot/f_repobuild/Makefile b/fuel/build/f_isoroot/f_repobuild/Makefile index ad40d0b9a..0f5a6ac12 100644 --- a/fuel/build/f_isoroot/f_repobuild/Makefile +++ b/fuel/build/f_isoroot/f_repobuild/Makefile @@ -10,13 +10,22 @@ SHELL := /bin/bash TOP := $(shell pwd) - RSYNC_HOST := $(shell ./select_ubuntu_repo.sh) + .PHONY: all all: nailgun nailgun: +# If RSYNC_CONNECT_PROG is set we need to do some magic to copy the +# keys. Make sure to have the username set in the SSH_CONNECT_PROG +# as well! + @if [ -n "${RSYNC_CONNECT_PROG}" -a ! -d /root/.ssh ]; then \ + sudo mkdir -p /root/.ssh; \ + test -d ${HOME}/.ssh && sudo find ${HOME}/.ssh -maxdepth 1 -type f -exec cp {} /root/.ssh \; ; \ + sudo bash -c "echo StrictHostKeyChecking=no > /root/.ssh/config"; \ + sudo chmod 700 /root/.ssh; \ + fi sudo apt-get install -y rsync python python-yaml dpkg-dev openssl rm -rf tmpiso tmpdir mkdir tmpiso @@ -27,7 +36,7 @@ nailgun: sudo dpkg -i fuel-createmirror_6.1*.deb sudo sed -i 's/DOCKER_MODE=true/DOCKER_MODE=false/' /etc/fuel-createmirror/common.cfg sudo sed -i 's/DEBUG="no"/DEBUG="yes"/' /etc/fuel-createmirror/ubuntu.cfg - sudo sed -i 's/MIRROR_UBUNTU_HOST="archive.ubuntu.com"/MIRROR_UBUNTU_HOST="${RSYNC_HOST}"/' /etc/fuel-createmirror/common.cfg + sudo sed -i "s/MIRROR_UBUNTU_HOST=\".*\"/MIRROR_UBUNTU_HOST=\"$(RSYNC_HOST)\"/" /etc/fuel-createmirror/common.cfg rm -Rf nailgun sudo mkdir -p /var/www sudo su - -c /opt/fuel-createmirror-6.1/fuel-createmirror |