Makefile: submodules sync with Fuel@OPNFV 13/17513/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 25 Jul 2016 16:00:18 +0000 (18:00 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 26 Jul 2016 15:17:19 +0000 (17:17 +0200)
Upstream change [1] pinned Fuel components to Fuel 9.0.1 specific
commits. While armband used to track remote branch HEAD, we now
need to sync with Fuel's config.mk before applying our patches.

Unfortunately, the commit variables are not consistently named,
so one could infer a relationship between the variable names
and targeted git submodule (e.g. fuel-web commit var is named
NAILGUN_COMMIT), so we have to hardcode the module list in our
Makefile.

[1] https://gerrit.opnfv.org/gerrit/#/c/17225

Closes: ARMBAND-58

Change-Id: Ifdce1c9a5afbd70db3b5703da21b30e8792b3e97
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
.gitignore
Makefile

index 751b1d0..b7d93b2 100644 (file)
@@ -1 +1,2 @@
 build.log
+config.mk
index 922b72e..df14ef6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,18 @@
 root:=$(shell pwd)
+include config.mk
 
 all: build
 
+config.mk: submodules-init
+       @ln -s -f ${root}/upstream/fuel/build/config.mk ${root}/config.mk
+
 .PHONY: submodules-init submodules-clean
 submodules-init:
-       @git submodule -q init
-       @git submodule -q sync
-       @git submodule update --remote
+       @if [ ! -d ${root}/upstream/fuel/build ]; then \
+               git submodule -q init; \
+               git submodule -q sync; \
+               git submodule update --remote; \
+       fi
 
 # Cleans any changes made to submodules
 submodules-clean:
@@ -28,6 +34,18 @@ patches-export:
 
 # apply patches from patches/* to respective submodules
 patches-import:
+       @cd ${root}/upstream/fuel-agent && \
+               git checkout -q ${FUEL_AGENT_COMMIT}
+       @cd ${root}/upstream/fuel-astute && \
+               git checkout -q ${ASTUTE_COMMIT}
+       @cd ${root}/upstream/fuel-library && \
+               git checkout -q ${FUELLIB_COMMIT}
+       @cd ${root}/upstream/fuel-mirror && \
+               git checkout -q ${FUEL_MIRROR_COMMIT}
+       @cd ${root}/upstream/fuel-nailgun-agent && \
+               git checkout -q ${FUEL_NAILGUN_AGENT_COMMIT}
+       @cd ${root}/upstream/fuel-web && \
+               git checkout -q ${NAILGUN_COMMIT}
        @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
        @git submodule -q foreach 'git tag armband-workbench-root'
        @git submodule -q foreach 'git checkout -q -b armband-workbench'