Pass revision version to the build fuel system 63/12563/2
authorJosep Puigdemont <josep.puigdemont@enea.com>
Fri, 22 Apr 2016 09:07:40 +0000 (11:07 +0200)
committerJosep Puigdemont <josep.puigdemont@enea.com>
Fri, 22 Apr 2016 09:16:17 +0000 (11:16 +0200)
Fuel makes use of the REVSTATE variable in the make file to alter the
name of the resulting ISO image. We need to honor the revision specified
by the jenkins build system at OPNFV, and pass this variable along to
fuel@opnfv.

Change-Id: I1f80dfcae313058dd9a4486bbbfdfbb0b52ea405
Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
Makefile
ci/build.sh

index 0b285a9..f954a61 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,10 @@ clean-build:
 release: export LC_ALL=en_US.UTF-8
 release: submodules-clean clean-docker clean-build submodules-init patches-import build
 
+ifneq ($(REVSTATE),)
+    EXTRA_PARAMS="REVSTATE=$(REVSTATE)"
+endif
+
 build:
        cd ${root}/upstream/fuel/build && \
                time make \
@@ -79,5 +83,6 @@ build:
                        MIRROR_UBUNTU_URL=http://archive.ubuntu.com/ubuntu/ \
                        LATEST_MIRROR_ID_URL=http://linux.enea.com/ \
                        JAVA8_URL=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_arm64.deb \
+                       $(EXTRA_PARAMS) \
                        iso 2>&1 | tee ${root}/build.log
 
index 99de559..38be254 100755 (executable)
@@ -32,11 +32,20 @@ SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
 BUILD_BASE="${SCRIPT_DIR}/upstream/fuel/build"
 RESULT_DIR="${BUILD_BASE}/release"
 
-make release || error_exit "Make release failed"
+make REVSTATE="${OPNFV_ARTIFACT_VERSION}" release ||
+    error_exit "Make release failed"
 
-write_gitinfo >> ${BUILD_BASE}/gitinfo.txt
+write_gitinfo >> ${BUILD_BASE}/gitinfo_armband.txt
 
 echo "Copying results to $OUTPUT_DIR"
 sort ${BUILD_BASE}/gitinfo*.txt > ${OUTPUT_DIR}/gitinfo.txt
 cp ${RESULT_DIR}/*.iso ${OUTPUT_DIR}/
 cp ${RESULT_DIR}/*.iso.txt ${OUTPUT_DIR}/
+
+# We need to build our own ODL plugin, and when this happens, fuel
+# renames the iso to unofficial-opnfv-${REVSTATE}.iso, so here we remove
+# the prefix:
+pushd ${OUTPUT_DIR} > /dev/null
+rename 's/^unofficial-//' *.iso
+rename 's/^unofficial-//' *.iso.txt
+popd > /dev/null