Support for selecting which plugins to build 89/3889/3
authorStefan K. Berg <stefan.k.berg@ericsson.com>
Wed, 2 Dec 2015 15:27:41 +0000 (16:27 +0100)
committerStefan K. Berg <stefan.k.berg@ericsson.com>
Thu, 3 Dec 2015 10:28:16 +0000 (11:28 +0100)
In order to cut the build time for unofficial builds, this change
supports setting the environment variable "BUILD_FUEL_PLUGINS" prior
to building.

Only the plugin targets from fuel/build/f_isoroot/Makefile that are
specified will then be built. In order to completely disable the
building of plugins, the environment variable is set to " ".

When using this functionality, the resulting iso file will be
prepended with the prefix "unofficial-" to clearly indiciate that
this is not a full build.

Change-Id: Ib0a914ed6577f54f31b056a752691316302081dc
Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
build/Makefile
build/docker/runcontext
build/f_isoroot/Makefile
docs/build-instructions.rst

index 6e7041d..85da6eb 100644 (file)
@@ -22,7 +22,13 @@ export ISOSRC = file:$(shell pwd)/fuel-7.0.iso
 export ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC))
 export PRODNO = "OPNFV_BGS"
 export REVSTATE = "P0000"
+
+ifdef BUILD_FUEL_PLUGINS
+$(warning Overriding plugin build selection to $(BUILD_FUEL_PLUGINS))
+export NEWISO = $(shell pwd)/release/unofficial-opnfv-${REVSTATE}.iso
+else
 export NEWISO = $(shell pwd)/release/opnfv-${REVSTATE}.iso
+endif
 
 # Note! Invoke with "make REVSTATE=RXXXX all" to make release build!
 # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location.
index f9065a0..b442dee 100755 (executable)
@@ -111,7 +111,7 @@ if [ -n "$CACHEBASE" ]; then
     fi
 fi
 
-RUN_CONTEXT_OPT="--cidfile $CID_FILE --privileged=true --rm -e HOME=$HOME -e CACHEDEBUG -e CACHETRANSPORT -e CACHEMAXAGE -e CACHEBASE -u $USER_ID:$GROUP_ID -w $PWD -v $GITROOT:$GITROOT $CACHEMOUNT"
+RUN_CONTEXT_OPT="--cidfile $CID_FILE --privileged=true --rm -e HOME=$HOME -e CACHEDEBUG -e CACHETRANSPORT -e CACHEMAXAGE -e CACHEBASE -e BUILD_FUEL_PLUGINS -u $USER_ID:$GROUP_ID -w $PWD -v $GITROOT:$GITROOT $CACHEMOUNT"
 
 # Passing "debug" puts up an interactive bash shell
 if [ "$1" == "debug" ]; then
index 84c17c0..a031341 100644 (file)
@@ -8,7 +8,17 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-SUBDIRS = f_kscfg f_bootstrap f_repobuild f_odlpluginbuild f_qemupluginbuild f_ovs-nsh-dpdk-pluginbuild f_onosfwpluginbuild
+# Add Fuel plugin build targets here
+PLUGINS = f_odlpluginbuild f_qemupluginbuild f_ovs-nsh-dpdk-pluginbuild f_onosfwpluginbuild
+
+# If the BUILD_FUEL_PLUGINS environment variable is set, only build the plugins
+# indicated therein.
+ifdef BUILD_FUEL_PLUGINS
+SUBDIRS = f_kscfg f_bootstrap f_repobuild $(BUILD_FUEL_PLUGINS)
+$(warning Overriding plugin build selection to $(BUILD_FUEL_PLUGINS))
+else
+SUBDIRS = f_kscfg f_bootstrap f_repobuild $(PLUGINS)
+endif
 SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
 
 .PHONY: all
index 08b5603..aa8077e 100644 (file)
@@ -34,6 +34,10 @@ Version history
 | 2015-10-23         | 1.1.1              | Stefan Berg        | Added instructions   |
 |                    |                    | (Ericsson AB)      | for proxy builds     |
 +--------------------+--------------------+--------------------+----------------------+
+| 2015-12-03         | 1.2.0              | Stefan Berg        | Added instructions   |
+|                    |                    | (Ericsson AB)      | for plugin build     |
+|                    |                    |                    | selection            |
++--------------------+--------------------+--------------------+----------------------+
 
 Introduction
 ============
@@ -210,6 +214,23 @@ Configure your build environment
 
 Select the versions of the components you want to build by editing the fuel/build/config.mk file.
 
+Non official build: Selecting which plugins to build
+----------------------------------------------------
+In order to cut the build time for unofficial builds (made by an
+individual developer locally), the selection if which Fuel plugins to
+build (if any) can be done by environment variable
+"BUILD_FUEL_PLUGINS" prior to building.
+
+Only the plugin targets from fuel/build/f_isoroot/Makefile that are
+specified in the environment variable will then be built. In order to
+completely disable the building of plugins, the environment variable
+is set to " ". When using this functionality, the resulting iso file
+will be prepended with the prefix "unofficial-" to clearly indiciate
+that this is not a full build.
+
+This method of plugin selection is not meant to be used from within
+Gerrit!
+
 Low level build method using make
 ---------------------------------
 The low level method is based on Make: