Merge redundant build jobs into a single template 89/56689/3
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 8 May 2017 21:37:37 +0000 (17:37 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 8 May 2017 22:37:04 +0000 (18:37 -0400)
Not necessary to define multiple templates that differ only in 1 line of
the Maven Goals parameter. This patch removes the redundant job
templates and adds a new EXTRA_MVN_OPTS parameter that can optionally be
used to pass additional parameters if necessary both at runtime and per
stream by passing the {extra-mvn-opts} jjb parameter.

Additionally:

    - Removes archiving of sar data in Jenkins (we shouldn't be
      archiving anything in Jenkins).
    - Revert archiving of **.zip files as we are able to produce
      staging repos now.

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

index 524a67a3dcdff69e82bf3bc6d142df74659b56f5..e61a0fe5a99bb9afebc6dfc42206dafde54690bf 100644 (file)
@@ -17,6 +17,7 @@
           jdk: 'openjdk8'
           integration-test: carbon
           karaf-version: karaf3
+          extra-mvn-opts: -Dskip.karaf.featureTest=true
       - boron:
           next-release-tag: Boron-SR4
           branch: 'stable/boron'
             fail-on-missing: true
       - opendaylight-infra-shiplogs:
           maven-version: 'mvn33'
-
-
-###
-# TODO: Remove this job once carbon tests failures are resolved
-# This jobs skips all tests and is intended to stage artifacts for integration
-# testing
-###
-
-- project:
-    name: autorelease-projects-notests
-    jobs:
-      - 'autorelease-release-notests-{stream}'
-
-    stream:
-      - carbon:
-          next-release-tag: Carbon
-          branch: 'stable/carbon'
-          jdk: 'openjdk8'
-          integration-test: carbon
-          karaf-version: karaf3
-
-
-    project: 'releng/autorelease'
-    archive-artifacts: '**/*.prop **/*.log **/patches/*.bundle **/patches/*.patch all-bundles.tar.gz'
-
-
-# Autorelease build jobs
-- job-template:
-    name: 'autorelease-release-notests-{stream}'
-
-    project-type: freestyle
-    node: centos7-autorelease-4c-16g
-    jdk: '{jdk}'
-    cron: 'H 0 * * *'
-
-    properties:
-      - build-discarder:
-          days-to-keep: '30'
-          num-to-keep: 40
-          artifact-num-to-keep: 1
-    # Make sure we only archive the last artifact until we figure out why
-    # autorelease carbon is not generating a staging repo.
-    #   - opendaylight-infra-properties:
-    #       build-days-to-keep: '30'
-
-    parameters:
-      - maven-exec:
-          maven-version: 'mvn33'
-      - opendaylight-infra-parameters:
-          os-cloud: '{os-cloud}'
-          project: '{project}'
-          branch: '{branch}'
-          refspec: 'refs/heads/{branch}'
-          artifacts: '{archive-artifacts}'
-      - distribution-karaf-version:
-          karaf-version: '{karaf-version}'
-      - autorelease-release-tag:
-          release-tag: '{next-release-tag}'
-      - autorelease-release-branch:
-          release-branch: '{branch}'
-
-    scm:
-      - git:
-          credentials-id: 'opendaylight-jenkins-ssh'
-          url: '$GIT_BASE'
-          refspec: '$GERRIT_REFSPEC'
-          branches:
-            - '$GERRIT_BRANCH'
-          choosing-strategy: 'gerrit'
-          skip-tag: true
-          submodule:
-            recursive: true
-            timeout: 60
-
-    wrappers:
-      - opendaylight-infra-wrappers:
-          build-timeout: '1440'
-
-    triggers:
-      - timed: '{cron}'
-
-    builders:
-      # force jenkins install of maven version before any shell scripts use it
-      - maven-target:
-          maven-version: 'mvn33'
-          goals: '-version'
-          settings: 'autorelease-settings'
-          settings-type: cfp
-          global-settings: 'odl-global-settings'
-          global-settings-type: cfp
-      - wipe-local-maven-repo
-      - jacoco-nojava-workaround
-      - shell: "./scripts/list-project-dependencies.sh"
-      - autorelease-determine-merge-order
-      - autorelease-cfp:
-          autorelease-settings: 'autorelease-settings'
-          odl-global-settings: 'odl-global-settings'
-      - autorelease-generate-taglist
-      - autorelease-distribute-taglist
-      - distribute-build-url:
-          path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
-      - autorelease-generate-release-patches
-      # In a perfect world projects should be releasing separately and we consume them
-      # via a project that pulls the release bits from each project from Nexus.
-      # Keep the patches compatible with that ideal, but apply an edit
-      # to enable building in a single maven reactor afterwards.
-      - autorelease-fix-relative-paths
-      - maven-target:
-          maven-version: 'mvn33'
-          pom: 'pom.xml'
-          goals: |
-              clean deploy
-              -Pintegrationtests,docs,repoBuild
-              -Dcheckstyle.skip=true
-              -DskipTests=true
-              -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
-              {opendaylight-infra-mvn-opts}
-          java-opts:
-            - '-Xmx10g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
-          settings: 'autorelease-settings'
-          settings-type: cfp
-          global-settings: 'odl-global-settings'
-          global-settings-type: cfp
-      - autorelease-maven-deploy
-      - autorelease-get-integration-test-variables
-      - autorelease-maven-sources:
-          opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
-          maven-version: 'mvn33'
-          settings: 'autorelease-settings'
-          global-settings: 'odl-global-settings'
-      - autorelease-maven-sources-post-process
-      - shell: |
-          mkdir -p archives/
-          cp *.log *.prop $_
-
-    publishers:
-      - opendaylight-infra-notify-status
-      - opendaylight-infra-sysstats
-      - archive:
-          # Need to archive dependencies.log in Jenkins to provide a simple
-          # way for downstream jobs to pull the latest version of this file
-          # in their builds.
-          # TODO stop archiving **/*.zip once we figure out why artifacts are
-          #      not deploying to Nexus
-          artifacts: 'dependencies.log, **/*.zip, /var/log/sa/*'
-      - opendaylight-infra-shiplogs:
-          maven-version: 'mvn33'
-
-
-###
-# TODO: Remove this job once carbon tests failures are resolved
-# This jobs uses -fn (fail never) and is intended to run the build until
-# complition without being intruptted on test failures.
-###
-
-- project:
-    name: autorelease-projects-failnever
-    jobs:
-      - 'autorelease-release-failnever-{stream}'
-
-    stream:
-      - carbon:
-          next-release-tag: Carbon
-          branch: 'stable/carbon'
-          jdk: 'openjdk8'
-          integration-test: carbon
-          karaf-version: karaf3
-
-    project: 'releng/autorelease'
-    archive-artifacts: '**/*.prop **/*.log **/patches/*.bundle **/patches/*.patch all-bundles.tar.gz'
-
-
-# Autorelease build jobs
-- job-template:
-    name: 'autorelease-release-failnever-{stream}'
-
-    project-type: freestyle
-    node: centos7-autorelease-4c-16g
-    jdk: '{jdk}'
-    cron: 'H 0 * * *'
-
-    properties:
-      - build-discarder:
-          days-to-keep: '30'
-          num-to-keep: 40
-          artifact-num-to-keep: 1
-    # Make sure we only archive the last artifact until we figure out why
-    # autorelease carbon is not generating a staging repo.
-    #   - opendaylight-infra-properties:
-    #       build-days-to-keep: '30'
-
-    parameters:
-      - maven-exec:
-          maven-version: 'mvn33'
-      - opendaylight-infra-parameters:
-          os-cloud: '{os-cloud}'
-          project: '{project}'
-          branch: '{branch}'
-          refspec: 'refs/heads/{branch}'
-          artifacts: '{archive-artifacts}'
-      - distribution-karaf-version:
-          karaf-version: '{karaf-version}'
-      - autorelease-release-tag:
-          release-tag: '{next-release-tag}'
-      - autorelease-release-branch:
-          release-branch: '{branch}'
-
-    scm:
-      - git:
-          credentials-id: 'opendaylight-jenkins-ssh'
-          url: '$GIT_BASE'
-          refspec: '$GERRIT_REFSPEC'
-          branches:
-            - '$GERRIT_BRANCH'
-          choosing-strategy: 'gerrit'
-          skip-tag: true
-          submodule:
-            recursive: true
-            timeout: 60
-
-    wrappers:
-      - opendaylight-infra-wrappers:
-          build-timeout: '1440'
-
-    triggers:
-      - timed: '{cron}'
-
-    builders:
-      # force jenkins install of maven version before any shell scripts use it
-      - maven-target:
-          maven-version: 'mvn33'
-          goals: '-version'
-          settings: 'autorelease-settings'
-          settings-type: cfp
-          global-settings: 'odl-global-settings'
-          global-settings-type: cfp
-      - wipe-local-maven-repo
-      - jacoco-nojava-workaround
-      - shell: "./scripts/list-project-dependencies.sh"
-      - autorelease-determine-merge-order
-      - autorelease-cfp:
-          autorelease-settings: 'autorelease-settings'
-          odl-global-settings: 'odl-global-settings'
-      - autorelease-generate-taglist
-      - autorelease-distribute-taglist
-      - distribute-build-url:
-          path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
-      - autorelease-generate-release-patches
-      # In a perfect world projects should be releasing separately and we consume them
-      # via a project that pulls the release bits from each project from Nexus.
-      # Keep the patches compatible with that ideal, but apply an edit
-      # to enable building in a single maven reactor afterwards.
-      - autorelease-fix-relative-paths
-      - maven-target:
-          maven-version: 'mvn33'
-          pom: 'pom.xml'
-          goals: |
-              clean deploy
-              -Pintegrationtests,docs,repoBuild
-              -Dcheckstyle.skip=true
-              -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
-              -Dskip.karaf.featureTest=true
-              -fn
-              {opendaylight-infra-mvn-opts}
-          java-opts:
-            - '-Xmx10g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
-          settings: 'autorelease-settings'
-          settings-type: cfp
-          global-settings: 'odl-global-settings'
-          global-settings-type: cfp
-      - autorelease-maven-deploy
-      - autorelease-get-integration-test-variables
-      - autorelease-maven-sources:
-          opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
-          maven-version: 'mvn33'
-          settings: 'autorelease-settings'
-          global-settings: 'odl-global-settings'
-      - autorelease-maven-sources-post-process
-      - shell: |
-          mkdir -p archives/
-          cp *.log *.prop $_
-
-    publishers:
-      - opendaylight-infra-notify-status
-      - opendaylight-infra-sysstats
-      - archive:
-          # Need to archive dependencies.log in Jenkins to provide a simple
-          # way for downstream jobs to pull the latest version of this file
-          # in their builds.
-          # TODO stop archiving **/*.zip once we figure out why artifacts are
-          #      not deploying to Nexus
-          artifacts: 'dependencies.log, **/*.zip, /var/log/sa/*'
-      - opendaylight-infra-shiplogs:
-          maven-version: 'mvn33'
index 9723dd4cbec0e1e318fecb820fd1e88463090e0a..cae8e5988fd9a7c1e0f51481b7e442385a2246c8 100644 (file)
@@ -8,15 +8,12 @@
     jdk: '{jdk}'
     cron: 'H 0 * * *'
 
+    # Default variable values
+    extra-mvn-opts: ''
+
     properties:
-      - build-discarder:
-          days-to-keep: '30'
-          num-to-keep: 40
-          artifact-num-to-keep: 1
-    # Make sure we only archive the last artifact until we figure out why
-    # autorelease carbon is not generating a staging repo.
-    #   - opendaylight-infra-properties:
-    #       build-days-to-keep: '30'
+      - opendaylight-infra-properties:
+          build-days-to-keep: '30'
 
     parameters:
       - maven-exec:
           release-tag: '{next-release-tag}'
       - autorelease-release-branch:
           release-branch: '{branch}'
+      - string:
+          name: EXTRA_MVN_OPTS
+          default: '{extra-mvn-opts}'
+          description: |
+              Additional optional Maven Options to pass to the Maven Goals
+              parameter.
+
+              Examples:
+              -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
+              --fail-never   # NEVER fail the build, regardless of project result
+              --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
 
     scm:
       - git:
@@ -85,6 +93,7 @@
           pom: 'pom.xml'
           goals: |
               clean deploy
+              $EXTRA_MVN_OPTS
               -Pintegrationtests,docs,repoBuild
               -Dcheckstyle.skip=true
               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
           # Need to archive dependencies.log in Jenkins to provide a simple
           # way for downstream jobs to pull the latest version of this file
           # in their builds.
-          # TODO stop archiving **/*.zip once we figure out why artifacts are
-          #      not deploying to Nexus
-          artifacts: 'dependencies.log, **/*.zip, /var/log/sa/*'
+          artifacts: 'dependencies.log'
       - trigger-parameterized-builds:
           - project: 'autorelease-generate-release-notes-{stream}'
             condition: UNSTABLE_OR_BETTER