- 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
- cd /tmp/fuel-main && make repos
- $(REPOINFO) -r /tmp/fuel-main > gitinfo_fuel.txt
- # Repeat build up to ten times
- sudo ./fuel_build_loop
- cp /tmp/fuel-main/build/artifacts/fuel*.iso .
+ sudo apt-get install apt-transport-https ca-certificates -y
+ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
+ echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
+ sudo apt-get update -y
+ sudo apt-get install docker-engine -y
+ sudo sh -c 'echo DOCKER_OPTS=\"--bip 172.45.0.1/24\" > /etc/default/docker'
+ sudo service docker stop || exit 0
+ sudo service docker start
+
+ cd $(FUEL_MAIN_DIR) && ./prepare-build-env.sh
+ # Verify that Docker is alive
+ sudo docker info
+ # fuel-main Makefiles do not like `make -C`
+ cd $(FUEL_MAIN_DIR) && make repos
+ $(REPOINFO) -r $(FUEL_MAIN_DIR) > gitinfo_fuel.txt
+ # OPNFV patches at Fuel build time
+ # Need to be commited in order for them to be considered by the Fuel
+ # build system
+ $(foreach patch,$(FUEL_PATCHES),git \
+ -C $(subst $(BUILD_BASE)/patch-repos,$(FUEL_MAIN_DIR),$(dir $(patch))) \
+ am --whitespace=nowarn --committer-date-is-author-date $(patch) || \
+ (echo 'Error: Failed patching Fuel repos!' ; exit 1);)
+
+ # Repeat build up to three times
+ sudo -E ./fuel_build_loop
+ cp $(FUEL_MAIN_DIR)/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