From 956499a7e3a01d8dbe0081cef210a523d507d90d Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Mon, 23 Nov 2015 17:30:22 -0800 Subject: [PATCH] Adding ability to build from different distribution branches Change-Id: I5925a9140bea476b3d5b258605b3435eb4f9cc77 Signed-off-by: Jamo Luhrsen --- ...raw-integration-multipatch-distribution-test.sh | 14 ++++++++++---- jjb/integration/integration-test-jobs.yaml | 2 ++ jjb/releng-macros.yaml | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/jjb/integration/include-raw-integration-multipatch-distribution-test.sh b/jjb/integration/include-raw-integration-multipatch-distribution-test.sh index 7d616ceb5..b84122c7a 100644 --- a/jjb/integration/include-raw-integration-multipatch-distribution-test.sh +++ b/jjb/integration/include-raw-integration-multipatch-distribution-test.sh @@ -1,6 +1,7 @@ # create a fresh empty place to build this custom distribution BUILD_DIR=${WORKSPACE}/patch_tester POM_FILE=${WORKSPACE}/patch_tester/pom.xml +DISTRIBUTION_BRANCH_TO_BUILD=$BRANCH #renaming variable for clarity rm -rf $BUILD_DIR mkdir -p $BUILD_DIR @@ -42,13 +43,11 @@ do git fetch https://git.opendaylight.org/gerrit/${PROJECT} refs/changes/${PATCH} git checkout FETCH_HEAD cd $BUILD_DIR - done +# if distribution was not cloned above, we still need to get it if [ "${distribution_status}" == "not_patched" ]; then - # clone distribution and add it as a module in root pom git clone https://git.opendaylight.org/gerrit/p/integration/distribution - # TODO: Should we add support for non-master distribution branches? echo "distribution" >> $POM_FILE fi @@ -56,6 +55,13 @@ fi echo "" >> $POM_FILE echo "" >> $POM_FILE +# by default we can stay in master branch or checkout something else here +if [ "${DISTRIBUTION_BRANCH_TO_BUILD}" != "master" ]; then + cd distribution + git checkout ${DISTRIBUTION_BRANCH_TO_BUILD} +fi + + # Extract the BUNDLEVERSION from the distribution pom.xml BUNDLEVERSION=`xpath $BUILD_DIR/distribution/pom.xml '/project/version/text()' 2> /dev/null` echo "Bundle version is ${BUNDLEVERSION}" @@ -65,4 +71,4 @@ echo "Bundle url is ${BUNDLEURL}" # Set BUNDLEVERSION & BUNDLEURL echo BUNDLEVERSION=${BUNDLEVERSION} > ${WORKSPACE}/bundle.txt -echo BUNDLEURL=${BUNDLEURL} >> ${WORKSPACE}/bundle.txt \ No newline at end of file +echo BUNDLEURL=${BUNDLEURL} >> ${WORKSPACE}/bundle.txt diff --git a/jjb/integration/integration-test-jobs.yaml b/jjb/integration/integration-test-jobs.yaml index 123e44d85..71c0d9fb6 100644 --- a/jjb/integration/integration-test-jobs.yaml +++ b/jjb/integration/integration-test-jobs.yaml @@ -412,6 +412,8 @@ parameters: - patches-to-build-parameter: patches_to_build: '$PATCHES_TO_BUILD' + - integration-branch: + branch: '{branch}' wrappers: - build-timeout diff --git a/jjb/releng-macros.yaml b/jjb/releng-macros.yaml index cbd80dd03..39678b4fa 100644 --- a/jjb/releng-macros.yaml +++ b/jjb/releng-macros.yaml @@ -48,6 +48,14 @@ default: '' description: 'csv list of patches in project:changeset format to build distribution with' +- parameter: + name: distribution-branch-to-build-parameter + parameters: + - string: + name: DISTRIBUTION_BRANCH_TO_BUILD + default: 'master' + description: 'distribution repo branch to build with' + - scm: name: git-scm scm: -- 2.36.6