From 62c0166df8d9c411ccedd5fe9a308e4d7d7aa3f7 Mon Sep 17 00:00:00 2001 From: Michal Skalski Date: Sat, 26 Sep 2015 00:30:44 +0200 Subject: Try to choose close ubuntu mirror As described in this bug https://bugs.launchpad.net/fuel/+bug/1459252 slow connection to ubuntu mirror can lead to errors. Lets try choose mirror which is near build server. Change-Id: I7a367cbb6edbcf30dceb52934a9adf35cbd7ce5a Signed-off-by: Michal Skalski (cherry picked from commit f2752258649dc714a3c0adc8fa6aa4cfab405a45) --- fuel/build/f_isoroot/f_repobuild/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fuel/build/f_isoroot/f_repobuild/Makefile') diff --git a/fuel/build/f_isoroot/f_repobuild/Makefile b/fuel/build/f_isoroot/f_repobuild/Makefile index b8f0aa2..8722cbb 100644 --- a/fuel/build/f_isoroot/f_repobuild/Makefile +++ b/fuel/build/f_isoroot/f_repobuild/Makefile @@ -8,10 +8,17 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +SHELL := /bin/bash TOP := $(shell pwd) DOCKNAME = fuelrepo DOCKVERSION = 1.0 +# try to choose close ubuntu mirror which support rsync protocol +# https://bugs.launchpad.net/fuel/+bug/1459252 +MIRROR_URLS := $(shell curl -s http://mirrors.ubuntu.com/mirrors.txt) +MIRROR_HOSTS := $(shell for url in ${MIRROR_URLS}; do echo $$url | cut -d'/' -f3; done) +RSYNC_HOST := $(shell for host in ${MIRROR_HOSTS}; do echo > /dev/tcp/$${host}/873 && echo $$host && break; done) + .PHONY: all all: .nailgun @@ -26,6 +33,9 @@ all: .nailgun fusermount -u tmpiso rm -rf tmpiso 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 rm -Rf nailgun sudo mkdir -p /var/www sudo su - -c /opt/fuel-createmirror-6.1/fuel-createmirror -- cgit 1.2.3-korg