X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build%2FMakefile;h=ab60f005f3c4c13628e5d844d92dc7806bb9ddec;hb=f595c31b29147efb1410756b491ff7bf48d256ec;hp=0ad83bff678e80a427a27c2693fed5a910928076;hpb=8e599759ede512a773eccef59eb2824940307564;p=fuel.git diff --git a/build/Makefile b/build/Makefile index 0ad83bff6..ab60f005f 100644 --- a/build/Makefile +++ b/build/Makefile @@ -20,7 +20,7 @@ SHELL = /bin/bash #Input args export ISOSRC = file:$(shell pwd)/fuel-8.0.iso export ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC)) -export PRODNO = "OPNFV_BGS" +export PRODNO = "OPNFV_FUEL" export REVSTATE = "P0000" ifdef BUILD_FUEL_PLUGINS @@ -43,6 +43,24 @@ export DOCKERIMG = opnfv.org/ubuntu-builder:14.04 export TOPDIR := $(shell pwd) export REPOINFO := $(BUILD_BASE)/repo_info.sh +# Use snapshots +# Use nearby repositories +export MIRROR_UBUNTU_URL := $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.sh --url) +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://$(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 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" + +# uncomment and use: make print-VARIABLE +#print-% : ; @echo $* = $($*) + #Build subclasses SUBDIRS := f_isoroot @@ -82,7 +100,7 @@ $(ISOCACHE): cd /tmp/fuel-main && git checkout $(FUEL_MAIN_TAG) @echo "fuel" `git -C /tmp/fuel-main show | grep commit | head -1 | cut -d " " -f2` >> $(VERSION_FILE) # Patch for adding dosfstools, as Fuel 6.1 is running mkfs.vfat - cd /tmp/fuel-main && patch -p0 < $(TOPDIR)/fuel-main_5.patch + cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_5.patch # Patch for using the Czech Fuel mirror # cd /tmp/fuel-main && patch -p0 < $(TOPDIR)/fuel-main_7.patch # Remove Docker optimizations, otherwise multistrap will fail during @@ -91,14 +109,19 @@ $(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 -p0 < $(TOPDIR)/fuel-main_docker_version.patch + cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_docker_version.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 - # - cd /tmp/fuel-main && sudo make iso + # Repeat build up to ten times + sudo ./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) @@ -181,7 +204,10 @@ debug: cd /tmp/fuel-main && git checkout $(FUEL_MAIN_TAG) cd /tmp/fuel-main && make repos $(REPOINFO) -r /tmp/fuel-main > .cachedata - sha1sum fuel-main*.patch >> .cachedata + sha1sum *.patch >> .cachedata + sha1sum fuel_build_loop >> .cachedata + sha1sum config.mk >> .cachedata + sha1sum Makefile >> .cachedata $(CACHETOOL) getbiweek >> .cachedata cat .cachedata | $(CACHETOOL) getid > .cacheid # Not removing fuel-main as it is re-used in build