- New parameter BUILD_ORDER is required when topic is used.
- Documentation is updated.
Change-Id: Ib107967d8887a8ae73816ea0235ca117d33166e3
JIRA: RELENG-119
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
cherry-pick 59/60259/17 and build netvirt, finally it will checkout latest distribution
code and build a distribution. The resulting distribution is stored in Nexus and the URL
is stored in a variable called BUNDLE_URL visible in the job console.
+ This job also accepts a gerrit topic, for example: multipatch-build:topic=binding-tlc-rpc,
+ in this case the job will find all patches in the topic binding-tlc-rpc for the projects
+ specified in the BUILD_ORDER parameter and will build all projects from the first a patch
+ has been found, for successive projects the branch HEAD is used if no patch is found.
+ The job uses patch numbers to sort patches in the same project.
Use multipatch-build-fast (vs multipatch-build) for building projects fast (-Pq).
This job should not alter Gerrit votes for a given patch, nor will do anything with the
given patch unless the patch is added to the build list.
branch: 'master'
mvn-version: 'mvn33'
csit-list: !include: csit-jobs-fluorine.lst
+ build-order: >
+ infrautils mdsal controller aaa netconf daexim bgpcep ovsdb neutron
+ lispflowmapping openflowplugin coe genius sfc netvirt
- oxygen:
branch: 'stable/oxygen'
mvn-version: 'mvn33'
csit-list: !include: csit-jobs-oxygen.lst
+ build-order: >
+ infrautils mdsal controller aaa netconf daexim bgpcep ovsdb neutron
+ lispflowmapping openflowplugin coe genius sfc netvirt
- nitrogen:
branch: 'stable/nitrogen'
mvn-version: 'mvn33'
csit-list: !include: csit-jobs-nitrogen.lst
+ build-order: >
+ infrautils mdsal controller aaa netconf daexim bgpcep ovsdb neutron
+ lispflowmapping openflowplugin coe genius sfc netvirt
- project:
name: integration-distribution
parameters:
- patches-to-build-parameter:
patches_to_build: '$PATCHES_TO_BUILD'
- - run-test-parameter:
- run-test: 'false'
+ - build-order-parameter:
+ build-order: '{build-order}'
- build-fast-parameter:
build-fast: 'false'
+ - run-test-parameter:
+ run-test: 'false'
- integration-distribution-branch:
branch: '{branch}'
- integration-distribution-stream:
else
fast_option=""
fi
+# check if topic exists, e.g. topic=binding-tlc-rpc
+if [[ "${PATCHES_TO_BUILD}" == *topic* ]]; then
+ TOPIC="${PATCHES_TO_BUILD#*=}"
+ echo "Create topic ${TOPIC} patch list"
+ PATCHES_TO_BUILD=""
+ read -ra PROJECT_LIST <<< "${BUILD_ORDER}"
+ for PROJECT in "${PROJECT_LIST[@]}"; do
+ # get all patches number for a topic for a given project
+ IFS=$'\n' read -rd '' -a GERRIT_PATCH_LIST <<< "$(ssh -p 29418 jenkins-$SILO@git.opendaylight.org gerrit query status:open topic:${TOPIC} project:${PROJECT} \
+ | grep 'number:' | awk '{{ print $2 }}')" || true
+ echo "Add ${PROJECT}:${GERRIT_PATCH_LIST[*]}"
+ # add project if it is the first with patches or it is not the first
+ if [[ -z "${PATCHES_TO_BUILD}" && ! -z "${GERRIT_PATCH_LIST[*]}" ]]; then
+ PATCHES_TO_BUILD="${PROJECT}"
+ elif [[ ! -z "${PATCHES_TO_BUILD}" ]]; then
+ PATCHES_TO_BUILD="${PATCHES_TO_BUILD},${PROJECT}"
+ fi
+ # sort project patches
+ if [[ ! -z "${GERRIT_PATCH_LIST[*]}" ]]; then
+ REF_LIST=()
+ # create reference list with patch number-refspec
+ for PATCH in "${GERRIT_PATCH_LIST[@]}"; do
+ REFSPEC=$(ssh -p 29418 jenkins-$SILO@git.opendaylight.org gerrit query change:${PATCH} --current-patch-set \
+ | grep 'ref:' | awk '{{ print $2 }}')
+ REF_LIST+=("${PATCH}-${REFSPEC/refs\/changes\/}")
+ done
+ # sort reference list by patch number
+ IFS=$'\n' SORT_REF=$(sort <<<"${REF_LIST[*]}") && unset IFS
+ read -rd '' -a SORT_REF_LIST <<< "${SORT_REF[*]}" || true
+ # add refspec to patches to build list
+ for PATCH in "${SORT_REF_LIST[@]}"; do
+ PATCHES_TO_BUILD="${PATCHES_TO_BUILD}:${PATCH/*-/}"
+ done
+ fi
+ done
+fi
+
+echo "Patches to build: ${PATCHES_TO_BUILD}"
IFS=',' read -ra PATCHES <<< "${PATCHES_TO_BUILD}"
# For each patch:
default: ''
description: |
Ordered list of patches to build in the format of project=changeset (checkout) or
- project:changeset (cherry-pick) for example: genius=32/53632/9,netvirt:59/50259/47
+ project:changeset (cherry-pick) for example: genius=32/53632/9,netvirt:59/50259/47.
+ A topic is also allowed, for example: topic=binding-tlc-rpc
- parameter:
- name: run-test-parameter
+ name: build-order-parameter
parameters:
- string:
- name: RUN_TEST
- default: '{run-test}'
- description: 'Set true to run test after build'
+ name: BUILD_ORDER
+ default: '{build-order}'
+ description: 'Build order for multipatch test when topic is used'
- parameter:
name: build-fast-parameter
default: '{build-fast}'
description: 'Set true to build fast -Pq'
+- parameter:
+ name: run-test-parameter
+ parameters:
+ - string:
+ name: RUN_TEST
+ default: '{run-test}'
+ description: 'Set true to run test after build'
+
- parameter:
name: distribution-branch-to-build-parameter
parameters: