X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build%2FMakefile;h=01f6e414a7ec540d252659e608cafe45be376d55;hb=3dd4046492923109e7cf5fe9a00ce4a9fae24732;hp=316d24e076910abbdcde7cbebca39428ec757148;hpb=d0d32d0dcde36e4a6a60e5846bfa1204e98b2d10;p=fuel.git diff --git a/build/Makefile b/build/Makefile index 316d24e07..01f6e414a 100644 --- a/build/Makefile +++ b/build/Makefile @@ -49,11 +49,11 @@ export MIRROR_UBUNTU_URL := $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.s export MIRROR_UBUNTU := $(shell echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f3 ) export MIRROR_UBUNTU_ROOT := $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f4-) -export LATEST_MIRROR_ID_URL := http://mirror.seed-us1.fuel-infra.org +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/8.0.target.txt" | head -1) -export MIRROR_MOS_UBUNTU_ROOT := "/mos-repos/ubuntu/$(LATEST_TARGET_UBUNTU)" +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/mos8.0-centos7-fuel/os.target.txt" | head -1) export MIRROR_FUEL := "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/$(LATEST_TARGET_CENTOS)/x86_64" @@ -80,6 +80,12 @@ SUBCLEAN = $(addsuffix .clean,$(SUBDIRS)) all: @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1) @make -C docker + @lsb_release -a | grep Ubuntu > /dev/null 2>&1 || (echo 'Ubuntu is the only supported Linux distribution for this build system'; exit 1) + @KERNEL_VER=$$(uname -r); \ + KERNEL_VER="$${KERNEL_VER%.*-*}"; \ + KERNEL_VER="$${KERNEL_VER//.}"; \ + [ $$KERNEL_VER -ge 319 ] || (echo 'Kernel version must be 3.19 or newer'; exit 1) + @docker/runcontext $(DOCKERIMG) ping -c 1 www.google.com > /dev/null 2>&1 || (echo 'No docker network connectivity or name server - check your network- and docker settings'; exit 1) @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso @@ -110,14 +116,18 @@ $(ISOCACHE): # Need to replace the old Docker v. 1.5.0 with a later version to be # able to access the Docker remote repository! cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_docker_version.patch - # cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_docker_dns.patch # cd /tmp/fuel-main && ./prepare-build-env.sh + # Verify that Docker is alive + sudo docker info cd /tmp/fuel-main && make repos $(REPOINFO) -r /tmp/fuel-main > gitinfo_fuel.txt # Repeat build up to ten times - sudo ./fuel_build_loop + sudo -E ./fuel_build_loop cp /tmp/fuel-main/build/artifacts/fuel*.iso . + # Store artifact in cache straight away if caching is enabled + # (no .cacheid will be present unless this is a cached build) + test -f .cacheid && $(MAKE) -f Makefile put-cache || exit 0 .PHONY: mount-origiso umount-origiso mount-origiso: $(ISOCACHE)