From 50d93b109dc57822d6744c059101b2bf28a00dc4 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 4 Feb 2016 18:15:17 -0500 Subject: [PATCH] Make distribution-check job an ODL-releng templated job distribution-check is enabled by default. Projects can disable the distribution-check job by adding a configuration to the project.cfg files under the stream they would like to disable it on. For example: - beryllium: distribution-check: false Change-Id: I3ee9652b51e9e345c71ac0c196b1f31d5c27db3a Signed-off-by: Thanh Ha --- jjb-templates/distribution-check.yaml | 101 ++++++++++++++++++ .../integration-distribution-jobs.yaml | 97 ----------------- scripts/jjb-init-project.py | 8 +- 3 files changed, 108 insertions(+), 98 deletions(-) create mode 100644 jjb-templates/distribution-check.yaml diff --git a/jjb-templates/distribution-check.yaml b/jjb-templates/distribution-check.yaml new file mode 100644 index 000000000..d005eec9f --- /dev/null +++ b/jjb-templates/distribution-check.yaml @@ -0,0 +1,101 @@ +# Template: integration-patch-distribution-{stream} +# Goal: Build a patch and make sure the distribution can deploy with this change +# Operation: This job template builds a patch, creates a distribution containing +# the patch, and triggers the distribution deploy test + +- job-template: + name: 'PROJECT_SHORTNAME-distribution-check-{stream}' + disabled: '{obj:disable_distribution_check}' + + project-type: maven + node: dynamic_verify + jdk: '{jdk}' + + logrotate: + daysToKeep: '14' + numToKeep: '10' + artifactDaysToKeep: '{build-artifact-days-to-keep}' + artifactNumToKeep: '{build-artifact-num-to-keep}' + + parameters: + - gerrit-project-parameter: + project: '{project}' + - gerrit-refspec-parameter: + refspec: '{branch}' + - project-parameter: + project: '{project}' + - integration-distribution-git-url + + scm: + - integration-gerrit-scm: + credentials-id: '{ssh-credentials}' + basedir: '$GERRIT_PROJECT' + refspec: '$GERRIT_REFSPEC' + branch: '{branch}' + - integration-distribution-scm: + credentials-id: '{ssh-credentials}' + branch: '{branch}' + + wrappers: + - build-timeout + - ssh-agent-credentials: + users: + - '{ssh-credentials}' + + triggers: + - gerrit: + server-name: 'OpenDaylight' + trigger-on: + - patchset-created-event: + exclude-drafts: 'true' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'true' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'test-distribution' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + + prebuilders: + - integration-get-bundle-url + - inject: + properties-file: 'bundle.txt' + - wipe-org-opendaylight-repo + - maven-target: + maven-version: '{mvn33}' + pom: '$GERRIT_PROJECT/pom.xml' + goals: 'clean install -Djenkins -DskipTests -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -DgenerateReports=false -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -Dstream={stream}' + java-opts: + - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true' + settings: '{JENKINS_SETTINGS}' + global-settings: '{odl-global-settings}' + + maven: + maven-name: '{mvn33}' + root-pom: 'distribution/pom.xml' + goals: 'clean install -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r' + maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true' + settings: '{JENKINS_SETTINGS}' + global-settings: '{odl-global-settings}' + ignore-upstream-changes: true + post-step-run-condition: 'SUCCESS' + + postbuilders: + - trigger-builds: + - project: 'integration-distribution-deploy-{stream}' + block: true + predefined-parameters: + BUNDLEURL=$BUNDLEURL + + publishers: + - email-notification: + email-prefix: '[PROJECT_SHORTNAME]' diff --git a/jjb/integration/integration-distribution-jobs.yaml b/jjb/integration/integration-distribution-jobs.yaml index ed1676c7b..d4f11ef47 100644 --- a/jjb/integration/integration-distribution-jobs.yaml +++ b/jjb/integration/integration-distribution-jobs.yaml @@ -6,7 +6,6 @@ - 'integration-distribution-merge-{stream}' - 'integration-distribution-deploy-{stream}' - 'integration-distribution-offline-{stream}' - - 'integration-patch-distribution-{stream}' stream: - boron: @@ -237,99 +236,3 @@ artifacts: 'karaf.log' - email-notification: email-prefix: '[integration]' - -# Template: integration-patch-distribution-{stream} -# Goal: Build a patch and make sure the distribution can deploy with this change -# Operation: This job template builds a patch, creates a distribution containing the patch, and -# triggers the distribution deploy test - -- job-template: - name: 'integration-patch-distribution-{stream}' - - project-type: maven - node: dynamic_verify - jdk: '{jdk}' - - logrotate: - daysToKeep: '{build-days-to-keep}' - numToKeep: '{build-num-to-keep}' - artifactDaysToKeep: '{build-artifact-days-to-keep}' - artifactNumToKeep: '{build-artifact-num-to-keep}' - - parameters: - - gerrit-project-parameter: - project: '$GERRIT_PROJECT' - - gerrit-refspec-parameter: - refspec: '$GERRIT_REFSPEC' - - project-parameter: - project: '$GERRIT_PROJECT' - - integration-distribution-git-url - - scm: - - integration-gerrit-scm: - credentials-id: '{ssh-credentials}' - basedir: '$GERRIT_PROJECT' - refspec: '$GERRIT_REFSPEC' - branch: '{branch}' - - integration-distribution-scm: - credentials-id: '{ssh-credentials}' - branch: '{branch}' - - wrappers: - - build-timeout - - ssh-agent-credentials: - users: - - '{ssh-credentials}' - - triggers: - - gerrit: - server-name: 'OpenDaylight' - trigger-on: - - comment-added-contains-event: - comment-contains-value: 'test-distribution' - projects: - - project-compare-type: 'ANT' - project-pattern: '**' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - skip-vote: - successful: true - failed: true - unstable: true - notbuilt: true - - prebuilders: - - integration-get-bundle-url - - inject: - properties-file: 'bundle.txt' - - wipe-org-opendaylight-repo - - maven-target: - maven-version: '{mvn33}' - pom: '$GERRIT_PROJECT/pom.xml' - goals: 'clean install -Djenkins -DskipTests -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -DgenerateReports=false -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -Dstream={stream}' - java-opts: - - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true' - settings: '{integration-settings}' - global-settings: '{odl-global-settings}' - - maven: - maven-name: '{mvn33}' - root-pom: 'distribution/pom.xml' - goals: 'clean install -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r' - maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true' - settings: '{integration-settings}' - global-settings: '{odl-global-settings}' - ignore-upstream-changes: true - post-step-run-condition: 'SUCCESS' - - postbuilders: - - trigger-builds: - - project: 'integration-distribution-deploy-{stream}' - block: true - predefined-parameters: - BUNDLEURL=$BUNDLEURL - - publishers: - - email-notification: - email-prefix: '[$GERRIT_PROJECT]' diff --git a/scripts/jjb-init-project.py b/scripts/jjb-init-project.py index 417049d3b..64b582107 100644 --- a/scripts/jjb-init-project.py +++ b/scripts/jjb-init-project.py @@ -57,7 +57,9 @@ if os.path.isfile(project_conf): if cfg.get("JOB_TEMPLATES"): templates = cfg.get("JOB_TEMPLATES") else: - templates = "verify,merge,periodic,distribution,integration,sonar" + templates = ( + "verify,merge,periodic,distribution,distribution-check,integration," + "sonar") templates += ",clm" # ensure we always create a clm job for all projects templates += ",validate-autorelease" # Autorelease validate template @@ -91,6 +93,10 @@ for stream, options in streams.items(): str_streams += " disable_autorelease: %s\n" % (not options.get( "autorelease", False)) + # Disable the distribution-check job unless project enables it + str_streams += " disable_distribution_check: %s\n" % ( + not options.get("distribution-check", True)) + ############### # Handle JDKS # ############### -- 2.36.6