diff options
-rw-r--r-- | build/Makefile | 4 | ||||
-rw-r--r-- | build/f_isoroot/f_repobuild/Makefile | 4 | ||||
-rwxr-xr-x | build/f_isoroot/f_repobuild/select_ubuntu_repo.sh | 26 |
3 files changed, 28 insertions, 6 deletions
diff --git a/build/Makefile b/build/Makefile index ac854986c..fadb8a8ba 100644 --- a/build/Makefile +++ b/build/Makefile @@ -58,7 +58,9 @@ export MIRROR_UBUNTU_ROOT := $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" | export LATEST_MIRROR_ID_URL := http://$(shell ./select_closest_fuel_mirror.py) export MIRROR_MOS_UBUNTU ?= $(shell echo "$(LATEST_MIRROR_ID_URL)" | cut -d'/' -f3) -export LATEST_TARGET_UBUNTU := $(shell curl -sSf "$(MIRROR_MOS_UBUNTU)/mos-repos/ubuntu/$(MOSVERSION).target.txt" | head -1) +#export LATEST_TARGET_UBUNTU := $(shell curl -sSf "$(MIRROR_MOS_UBUNTU)/mos-repos/ubuntu/$(MOSVERSION).target.txt" | head -1) +# Fuel 9.0 +export LATEST_TARGET_UBUNTU := snapshots/9.0-2016-06-23-164100-copy export MIRROR_MOS_UBUNTU_ROOT := /mos-repos/ubuntu/$(LATEST_TARGET_UBUNTU) export LATEST_TARGET_CENTOS := $(shell curl -sSf "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos$(MOSVERSION)-centos7/os.target.txt" | head -1) diff --git a/build/f_isoroot/f_repobuild/Makefile b/build/f_isoroot/f_repobuild/Makefile index ad1a934fa..8beb8824f 100644 --- a/build/f_isoroot/f_repobuild/Makefile +++ b/build/f_isoroot/f_repobuild/Makefile @@ -53,9 +53,9 @@ release:nailgun @cp -Rp nailgun ../release/opnfv/nailgun @cp fuel_bootstrap_cli.yaml ../release/opnfv/ -############################################################################# +############################################################################ # Cache operations - only used when building through ci/build.sh -############################################################################# +############################################################################ # Create a unique hash to be used for getting and putting cache, based on: # - Year and week (causing the cache to be rebuilt weekly) diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh index 10a841171..24bd42234 100755 --- a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh +++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh @@ -1,4 +1,8 @@ #!/bin/bash + +BLACKLIST="http://mirrors.se.eu.kernel.org/ubuntu/" +#BLACKLIST+=" http://foo.bar" + cleanup() { rm -f $TMPFILE } @@ -7,6 +11,19 @@ debugmsg() { test -n "$DEBUG" && echo "$@" >&2 } + +# Check if url is blacklisted in this script +blacklisted () { + for blackurl in $BLACKLIST + do + if [ "$1" == "$blackurl" ]; then + return 0 + fi + done + return 1 +} + + # Check mirror's integrity check_mirror () { mirror=$1 @@ -57,7 +74,7 @@ DEBUG=1 TMPFILE=$(mktemp /tmp/mirrorsXXXXX)A trap cleanup exit -# Generated a list of mirrors considered as "up" +# Generate a list of mirrors considered as "up" curl -s https://launchpad.net/ubuntu/+archivemirrors | \ grep -P -B8 "statusUP|statusSIX" | \ grep -o -P "(f|ht)tp.*\"" | \ @@ -67,8 +84,11 @@ curl -s https://launchpad.net/ubuntu/+archivemirrors | \ # and sane. for url in $(curl -s http://mirrors.ubuntu.com/mirrors.txt) do - grep -q $url $TMPFILE || debugmsg "$url Faulty (detected by Ubuntu)" - if [ -z $BESTURL ]; then + if ! grep -q $url $TMPFILE; then + debugmsg "$url Faulty (detected by Ubuntu)" + elif blacklisted $url; then + debugmsg "$url blacklisted" + elif [ -z $BESTURL ]; then if grep -q $url $TMPFILE && check_mirror $url; then debugmsg "$url: OK (setting as primary URL)" BESTURL=$url |