Ensure autorelease pull submodule HEAD of branch 95/75395/10
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 23 Aug 2018 03:08:19 +0000 (23:08 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 23 Aug 2018 23:19:14 +0000 (19:19 -0400)
Make sure that autorelease is always pulling the latest HEAD of branch
for all submodules. Push an update patch to releng/autorelease if it
is not.

Issue: RELENG-80
Change-Id: I04c8de08ed5da73030a036eeadece799b120b7a5
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/autorelease/autorelease-projects.yaml
jjb/autorelease/autorelease-templates.yaml

index 3be1513529649eedc27b0137d0f2679fe0bcca72..7818f8045d759551a6b5cb73e8667c8a73c21e2a 100644 (file)
@@ -6,6 +6,7 @@
       - 'autorelease-generate-release-notes-{stream}'
       - 'autorelease-release-{stream}':
           build-node: centos7-autorelease-8c-32g
+      - 'autorelease-update-submodules-{stream}'
       - 'autorelease-update-validate-jobs-{stream}'
       - 'autorelease-version-bump-{stream}':
           build-node: centos7-autorelease-8c-32g
index c6774da9c86da206b30b1ae8729d133a8466cf86..5280e00a3292df4bae64ee20acab2f547f783029 100644 (file)
           mark-unstable-if-failed: false
       - lf-infra-publish
 
+- job-template:
+    name: 'autorelease-update-submodules-{stream}'
+
+    ######################
+    # Default parameters #
+    ######################
+
+    cron: 'H 0 * * *'
+
+    #####################
+    # Job configuration #
+    #####################
+
+    project-type: freestyle
+    node: centos7-builder-2c-2g
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: 7
+
+    parameters:
+      - lf-infra-parameters:
+          project: releng/autorelease
+          branch: '{branch}'
+          stream: '{stream}'
+          refspec: 'refs/heads/{branch}'
+          lftools-version: '{lftools-version}'
+
+    scm:
+      - lf-infra-gerrit-scm:
+          git-url: '$GIT_URL/$GERRIT_PROJECT'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          jenkins-ssh-credential: opendaylight-jenkins-ssh
+          submodule-recursive: true
+          choosing-strategy: default
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: 10
+          jenkins-ssh-credential: opendaylight-jenkins-ssh
+
+    triggers:
+      - timed: '{obj:cron}'
+
+    builders:
+      # Fetch latest head of branch
+      - shell: |
+          git checkout $GERRIT_BRANCH
+          git submodule update --remote
+          git add .
+      - lf-infra-push-gerrit-patch:
+          project: '{project}'
+          gerrit-user: 'jenkins-$SILO'
+          gerrit-host: 'git.opendaylight.org'
+          gerrit-topic: 'autorelease-update-submodules'
+          gerrit-commit-message: 'Update submodules to latest HEAD of branch'
+          reviewers-email: ''
+
+    publishers:
+      - lf-infra-publish
+
 - job-template:
     name: autorelease-update-validate-jobs-{stream}