Make test-integration to rebase before build 95/30295/6
authorVratko Polak <vrpolak@cisco.com>
Tue, 1 Dec 2015 11:06:38 +0000 (12:06 +0100)
committerVratko Polak <vrpolak@cisco.com>
Tue, 1 Dec 2015 11:06:38 +0000 (12:06 +0100)
This is to resemble state at future merge more closely,
without need of explicit rebase in Gerrit.

Change-Id: I562ca5487413ba389640ecc644dff08b0e1891c4
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
jjb/integration/include-raw-integration-rebase-gerrit-patch.sh [new file with mode: 0644]
jjb/integration/integration-macros.yaml
jjb/integration/integration-test-jobs.yaml

diff --git a/jjb/integration/include-raw-integration-rebase-gerrit-patch.sh b/jjb/integration/include-raw-integration-rebase-gerrit-patch.sh
new file mode 100644 (file)
index 0000000..96dca8a
--- /dev/null
@@ -0,0 +1,10 @@
+# Make sure changes merged after patch creation are applied.
+
+set -exu
+echo "Rebase the patch on top of ${GERRIT_PROJECT}"
+cd "${GERRIT_PROJECT}"
+export EMAIL="sandbox@jenkins.opendaylight.org"
+# TODO: Is there a more appropriate e-mail?
+export GIT_COMMITTER_NAME="Rebase Macro"
+git rebase "origin/${BRANCH}"
+cd "${WORKSPACE}"
index bd34eae001aec17c92bcc4efc804c46f091ec954..d1c54ce3cb7ab1adc63325d7d5b2f30dc460acd1 100644 (file)
         - shell:
             !include-raw include-raw-integration-cleanup-workspace.sh
 
+# Macro: integration-rebase-patch
+# Operation: For cloned project, rebase checked-out Gerrit patch onto $BRANCH.
+# Used by: integration-patch-distribution-* job template
+
+- builder:
+    name: integration-rebase-gerrit-patch
+    builders:
+        - shell:
+            !include-raw include-raw-integration-rebase-gerrit-patch.sh
+
 ##############
 # Publishers #
 ##############
index 07cac23fd9bc4c82220390ba66009bb0673a4c45..d325e4f6929d350f5f81d762a6f147659ed5ba7d 100644 (file)
             refspec: '$GERRIT_REFSPEC'
         - project-parameter:
             project: '$GERRIT_PROJECT'
+        - integration-branch:
+            branch: '{branch}'
         - integration-distribution-git-url
 
     scm:
                 notbuilt: true
 
     prebuilders:
+        - integration-rebase-gerrit-patch
         - integration-get-bundle-url
         - inject:
             properties-file: 'bundle.txt'