1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 ############################################################################
12 # BEGIN of variables to customize
15 ISOSRC = file:$(shell pwd)/fuel-5.1.1.iso
16 ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC))
17 PRODUCT_NAME = "OPNFV_BGS"
19 NEWISO = $(shell pwd)/release/opnfv-${VERSION}.iso
20 DOCKERIMG = opnfv.org/ubuntu-builder:14.04
21 # Note! Invoke with "make VERSION=RXXXX iso" to make release build!
22 # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location.
24 # END of variables to customize
25 #############################################################################
26 TOPDIR := $(shell pwd)
27 ORIGDIR := $(TOPDIR)/origiso
30 SUBDIRS += f_opnfv_puppet
32 SUBDIRS += f_l23network
33 SUBDIRS += f_resolvconf
36 # f_example is only an example of how to generate a .deb package and
37 # should not be enabled in official builds.
40 SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
44 @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1)
46 @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso
49 # Clone Fuel to non-persistent location and build
50 cd /tmp && git clone https://github.com/stackforge/fuel-main
51 cd /tmp/fuel-main && git checkout 5.1.1
52 # Setup cgroups for docker-in-docker
53 sudo /root/enable_dockerx2
54 # Patch to fix race condition when doing "Docker-in-Docker" build
55 cd /tmp/fuel-main && patch -p1 < $(TOPDIR)/fuel-main.patches
56 # Remove Docker optimizations, otherwise multistrap will fail during
58 sudo rm -f /etc/apt/apt.conf.d/docker*
60 cd /tmp/fuel-main && ./prepare-build-env.sh
61 cd /tmp/fuel-main && make iso
62 mv /tmp/fuel-main/build/artifacts/fuel*.iso .
64 .PHONY: mount-origiso umount-origiso
65 mount-origiso: $(ISOCACHE)
66 @echo "Mounting original ISO in $(ORIGDIR)"
68 @fuseiso $(ISOCACHE) $(ORIGDIR)
71 @echo "Unmounting original ISO from $(ORIGDIR)"
72 @fusermount -u $(ORIGDIR)
77 @mkdir -p release/packages/ubuntu/pool/main release/puppet/modules release/isoroot
78 $(MAKE) -C $@ -f Makefile release
80 .PHONY: patch-packages
82 ORIGISO=$(ISOCACHE) VERSION=$(VERSION) $(MAKE) -C $@ -f Makefile release
84 .PHONY: clean $(SUBCLEAN)
86 $(MAKE) -C patch-packages -f Makefile clean
92 $(MAKE) -C $* -f Makefile clean
94 # Todo: Make things smarter - we shouldn't need to clean everything
95 # betwen make invocations.
97 iso: clean $(ISOCACHE) $(SUBDIRS) patch-packages
98 install/install.sh iso $(ISOCACHE) $(NEWISO) $(PRODUCT_NAME) $(VERSION)
99 @printf "\n\nProduct ISO is $(NEWISO)\n\n"