Add automatic update of next branch 43/26243/1
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 7 Apr 2021 21:36:04 +0000 (23:36 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 7 Apr 2021 21:37:10 +0000 (23:37 +0200)
After a merge we need to rebase our -next branch to be
synced with master.

Bug-AGL: SPEC-3846

Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Change-Id: I9881589ec192ccf1668e692ea9d4e1eb6476d418

jjb/ci-AGL-verify/ci-platform-jjb.yaml
jjb/common/include-agl-update-next.sh [new file with mode: 0644]

index 59ebd03..8fe3865 100644 (file)
@@ -33,6 +33,7 @@
       - ci-platform-{project}-verify-CIBT-{testmachine}
       - ci-platform-{project}-verify-CIBT-complete
       - ci-platform-{project}-verify-CIBT-finish-success
+      - ci-platform-{project}-merge-update-next
       - ci-platform-{project}-remove-artifacts
     description: "Managed by JJB. Do not Edit. \
                   <br>Build time graph:<br><img src='buildTimeGraph/png' />"
 ################################################################################################################################################################
 
 ################################################################################
+
+################################################################################
+# -merge-update-next
+################################################################################
+- job-template:
+    name: 'ci-platform-{project}-merge-update-next'
+    project-type: freestyle
+    concurrent: true
+    node: hwtest-slave
+    description: "Managed by JJB. Do not Edit. \
+                  <br>Build time graph:<br><img src='buildTimeGraph/png' />"
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: false
+    triggers:
+      - gerrit-trigger-silent-patch-merged:
+          name: 'AGL/{project}'
+          branch: 'master'
+    builders:
+      - shell:
+          !include-raw-escape:
+          - ../common/include-agl-header.sh
+          - ../common/include-agl-repo.sh
+          - ../common/include-agl-select.sh
+          - ../common/include-agl-update-next.sh
+
 ################################################################################
 # -remove-artifacts = merge/abandon, remove artifacts and later trigger sstate
 ################################################################################
diff --git a/jjb/common/include-agl-update-next.sh b/jjb/common/include-agl-update-next.sh
new file mode 100644 (file)
index 0000000..266f9bc
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# safety net
+if test x"master" = x"${TARGETBRANCH}" ; then
+    pushd $MYPROJECT
+     git config --local --add gitreview.username agl-jobbuilder
+     git config --local --add user.email collab-it+agl-jobbuilder@linuxfoundation.org
+     pip3 install git-review
+     export PATH=/home/jenkins/.local/bin:$PATH
+     git review -s
+     git remote -v update
+     git checkout -b next gerrit/next
+     git rebase gerrit/master
+     git push -f gerrit HEAD:next -f
+    popd
+fi
+
+cd ..
+rm -rf repoclone