From 77903edce4b3e8b4fdf7c0ff601ec24b74ffe962 Mon Sep 17 00:00:00 2001 From: JulienBe Date: Mon, 17 Jul 2017 15:30:26 +0200 Subject: Introduction of the checkstyle plugin Issue: CLAMP-2 Change-Id: Ic027d6aef676feb4e69bdba291c546fedfbacc3a Signed-off-by: JulienBe --- jjb/clamp/clamp.yaml | 4 +- jjb/global-macros.yaml | 38 ++++++++++++++ jjb/global-templates-java.yaml | 113 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+), 2 deletions(-) (limited to 'jjb') diff --git a/jjb/clamp/clamp.yaml b/jjb/clamp/clamp.yaml index 4f08ed0e1..130497f7c 100644 --- a/jjb/clamp/clamp.yaml +++ b/jjb/clamp/clamp.yaml @@ -4,9 +4,9 @@ name: clamp project-name: 'clamp' jobs: - - '{project-name}-{stream}-verify-java' + - '{project-name}-{stream}-verify-java-checkstyle' - '{project-name}-{stream}-merge-java' - - '{project-name}-{stream}-release-java-daily' + - '{project-name}-{stream}-release-java-daily-checkstyle' - '{project-name}-{stream}-docker-java-properties-daily': docker-pom: 'pom.xml' mvn-profile: 'docker' diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml index 2270f576c..454d056ef 100644 --- a/jjb/global-macros.yaml +++ b/jjb/global-macros.yaml @@ -168,6 +168,44 @@ healthy: 50 unhealthy: 40 +- publisher: + name: checkstyle-result + publishers: + - checkstyle: + pattern: '**/checkstyle-result.xml' + healthy: 0 + unhealthy: 100 + health-threshold: 'high' + thresholds: + unstable: + total-all: 30 + total-high: 15 + total-normal: 20 + total-low: 25 + new-all: 5 + new-high: 0 + new-normal: 2 + new-low: 5 + +- publisher: + name: checkstyle-result-daily + publishers: + - checkstyle: + pattern: '**/checkstyle-result.xml' + healthy: 0 + unhealthy: 100 + health-threshold: 'high' + thresholds: + unstable: + total-all: 30 + total-high: 15 + total-normal: 20 + total-low: 25 + new-all: 1 + new-high: 0 + new-normal: 1 + new-low: 1 + - publisher: name: infra-shiplogs # To archive things, the job will need to create an "archives" directory in diff --git a/jjb/global-templates-java.yaml b/jjb/global-templates-java.yaml index e58954b3f..580d65b36 100644 --- a/jjb/global-templates-java.yaml +++ b/jjb/global-templates-java.yaml @@ -185,6 +185,61 @@ - infra-shiplogs: maven-version: '{maven-version}' +- job-template: + # Job template for Java verify jobs running checkstyle at the end + # When checkstyle will be fully incorporated, it is meant to replace + # '{project-name}-{stream}-verify-java-checkstyle' + # The purpose of this job template is to run "maven clean install" for + # projects using this template. + # + # Required Variables: + # branch: git branch (eg. stable/lithium or master) + name: '{project-name}-{stream}-verify-java-checkstyle' + project-type: freestyle + concurrent: true + node: '{build-node}' + properties: + - infra-properties: + build-days-to-keep: '{build-days-to-keep}' + parameters: + - infra-parameters: + project: '{project}' + branch: '{branch}' + refspec: 'refs/heads/{branch}' + artifacts: '{archive-artifacts}' + - maven-exec: + maven-version: '{maven-version}' + scm: + - gerrit-trigger-scm: + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + submodule-recursive: '{submodule-recursive}' + wrappers: + - infra-wrappers: + build-timeout: '{build-timeout}' + triggers: + - gerrit-trigger-patch-submitted: + server: '{server-name}' + project: '{project}' + branch: '{branch}' + files: '**' + builders: + - provide-maven-settings: + global-settings-file: 'global-settings' + settings-file: '{mvn-settings}' + - maven-target: + maven-version: '{maven-version}' + goals: 'clean install -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + settings: '{mvn-settings}' + settings-type: cfp + global-settings: 'global-settings' + global-settings-type: cfp + publishers: + - infra-shiplogs: + maven-version: '{maven-version}' + - checkstyle-result + - job-template: # Job template for Java verify jobs that takes a maven template # @@ -377,6 +432,64 @@ - infra-shiplogs: maven-version: '{maven-version}' +- job-template: + # Job template for Java daily release jobs running checkstyle at the end + # When checkstyle will be fully incorporated, it is meant to replace + # '{project-name}-{stream}-release-java-daily' + # The purpose of this job template is to run "maven version && maven clean + # deploy" for projects using this template. + # + # Required Variables: + # branch: git branch (eg. stable/lithium or master) + name: '{project-name}-{stream}-release-java-daily-checkstyle' + project-type: freestyle + node: '{build-node}' + maven-deploy-properties: + properties: + - infra-properties: + build-days-to-keep: '{build-days-to-keep}' + parameters: + - infra-parameters: + project: '{project}' + branch: '{branch}' + refspec: 'refs/heads/{branch}' + artifacts: '{archive-artifacts}' + - maven-exec: + maven-version: '{maven-version}' + scm: + - gerrit-trigger-scm: + refspec: '' + choosing-strategy: 'default' + submodule-recursive: '{submodule-recursive}' + wrappers: + - infra-wrappers: + build-timeout: '{build-timeout}' + triggers: + # 11 AM UTC + - timed: 'H 11 * * *' + - gerrit-trigger-release-manually: + server: '{server-name}' + project: '{project}' + branch: '{branch}' + builders: + - provide-maven-settings: + global-settings-file: 'global-settings' + settings-file: '{mvn-settings}' + - maven-target: + maven-version: '{maven-version}' + goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + properties: + - '{maven-deploy-properties}' + settings: '{mvn-settings}' + settings-type: cfp + global-settings: 'global-settings' + global-settings-type: cfp + publishers: + - infra-shiplogs: + maven-version: '{maven-version}' + - checkstyle-result-daily + - job-template: # Job template for Java daily release jobs # -- cgit 1.2.3-korg