RELENG-103: Make -Pq configurable in multipatch 92/71492/2
authorLuis Gomez <ecelgp@gmail.com>
Fri, 27 Apr 2018 02:11:45 +0000 (19:11 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 27 Apr 2018 02:33:18 +0000 (19:33 -0700)
Default is to build normally, for fast build:

- If trigger from gerrit, use multipatch-build-fast:<patch-list>
- If trigger manually, set BUILD_FAST parameter to true

Change-Id: I51841a9c8b61c80c31b738d58d93b344d5da8e82
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
docs/jenkins.rst
jjb/integration/integration-test-jobs.yaml
jjb/integration/multipatch-distribution.sh
jjb/releng-macros.yaml

index 8ada1c7e66b924e09cfde88c297c87c99155458a..93c5bdf6eec32550604a5c9699e90c6a157af901 100644 (file)
@@ -805,6 +805,7 @@ TODO: Document test-{project}-{feature} and test-{project}-all.
           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.
+          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.
         </td>
index 97d882d1c4939d68b4baa8e9cd32b4e65f424663..1b0410be38697073335b0d0e3748f6371ed4a578 100644 (file)
     # (if not all) available CSIT jobs.
 
     project-type: freestyle
-    node: centos7-builder-4c-4g
+    node: centos7-builder-8c-8g
     jdk: '{java-version}'
 
     properties:
           patches_to_build: '$PATCHES_TO_BUILD'
       - run-test-parameter:
           run-test: 'false'
+      - build-fast-parameter:
+          build-fast: 'false'
       - integration-distribution-branch:
           branch: '{branch}'
       - integration-distribution-stream:
           server-name: '{gerrit-server-name}'
           trigger-on:
             - comment-added-contains-event:
-                comment-contains-value: 'multipatch-build:'
+                comment-contains-value: 'multipatch-build'
           projects:
             - project-compare-type: ANT
               project-pattern: '**'
           dist-pom: patch_tester/distribution/pom.xml
       - conditional-step:
           condition-kind: boolean-expression
-          condition-expression: $RUNTEST
+          condition-expression: $RUN_TEST
           steps:
             - trigger-builds:
                 - project: '{csit-list}'
index ce0fcb4f7f319ea147f3d58102743d4ec5ee6ad8..110e3f57316ecda66915f45bf4bccc4358bc3ef1 100644 (file)
@@ -29,10 +29,20 @@ export GIT_COMMITTER_NAME="Multipatch Job"
 #
 # multipatch-build:openflowplugin:45/69445/1,genius:46/69446/1,netvirt:47/69447/1
 if [ -n "$GERRIT_EVENT_COMMENT_TEXT" ]; then
-    # Grep the multipatch-build: line and then strip from the beginning to the :
-    PATCHES_TO_BUILD=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'multipatch-build:')
+    if [[ "$GERRIT_EVENT_COMMENT_TEXT" == *fast* ]]; then
+        BUILD_FAST="true"
+        PATCHES_TO_BUILD=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'multipatch-build-fast:')
+    else
+        BUILD_FAST="false"
+        PATCHES_TO_BUILD=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'multipatch-build:')
+    fi
     PATCHES_TO_BUILD=${PATCHES_TO_BUILD#*:}
 fi
+if ${BUILD_FAST}; then
+    fast_option="-Pq"
+else
+    fast_option=""
+fi
 IFS=',' read -ra PATCHES <<< "${PATCHES_TO_BUILD}"
 
 # For each patch:
@@ -100,7 +110,7 @@ do
     fi
     # Build project
     "$MVN" clean install \
-    -e -Pq \
+    -e ${fast_option} \
     -Dstream=oxygen \
     -Dgitid.skip=false \
     -Dmaven.gitcommitid.skip=false \
index f34d5aa7e19bb2e90792f4da3e2102c990f62d1f..f57959410608274c5f4200b4d047b899e9958e52 100644 (file)
     name: run-test-parameter
     parameters:
       - string:
-          name: RUNTEST
+          name: RUN_TEST
           default: '{run-test}'
           description: 'Set true to run test after build'
 
+- parameter:
+    name: build-fast-parameter
+    parameters:
+      - string:
+          name: BUILD_FAST
+          default: '{build-fast}'
+          description: 'Set true to build fast -Pq'
+
 - parameter:
     name: distribution-branch-to-build-parameter
     parameters: