Skip to content

Latest commit

 

History

History
551 lines (445 loc) · 43.6 KB

defaultResultsStage.md

File metadata and controls

551 lines (445 loc) · 43.6 KB

defaultResultsStage

The defaultResultsStage analyses the produced artifacts generated by maven. At the moment the following reports are supported:

The step also scans for open tasks via Warnings Next Generation Plugin.

Table of contents

Extension options

This step supports the extension mechanism, so you are able to extend the step by executing code before and/or after the step is executed or even replacing the whole functionality.

💡 See _extend for an example.

Configuration options

All configuration options must be inside the stageResults (ConfigConstants.STAGE_RESULTS) map element to be evaluated and used by the step.

import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*

defaultPreparationStage( 
  (STAGE_RESULTS) : [
    (STAGE_RESULTS_ENABLED) : true,
    (STAGE_RESULTS_EXTEND) : null,
    (STAGE_RESULTS_CHECKSTYLE) : [
      (STAGE_RESULTS_CHECKSTYLE_ENABLED) : true
    ],
    (STAGE_RESULTS_FINGERPRINT) : [
      (STAGE_RESULTS_FINGERPRINT_ENABLED) : true,
      (STAGE_RESULTS_FINGERPRINT_FILESET) : "**/target/**/*.zip,**/target/**/*.jar",
    ],
    (STAGE_RESULTS_JACOCO) : [
      (STAGE_RESULTS_JACOCO_ENABLED) : true,
      (STAGE_RESULTS_JACOCO_BUILD_OVER_BUILD): false,
      (STAGE_RESULTS_JACOCO_CHANGE_BUILD_STATUS): false,
      (STAGE_RESULTS_JACOCO_CLASS_PATTERN): '**/target/classes',
      (STAGE_RESULTS_JACOCO_DELTA_BRANCH_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_DELTA_CLASS_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_DELTA_COMPLEXITY_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_DELTA_INSTRUCTION_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_DELTA_LINE_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_DELTA_METHOD_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_EXEC_PATTERN): '**/target/**.exec',
      (STAGE_RESULTS_JACOCO_EXCLUSION_PATTERN): "",
      (STAGE_RESULTS_JACOCO_INCLUSION_PATTERN): "",
      (STAGE_RESULTS_JACOCO_MAXIMUM_BRANCH_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MAXIMUM_CLASS_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MAXIMUM_COMPLEXITY_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MAXIMUM_INSTRUCTION_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MAXIMUM_LINE_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MAXIMUM_METHOD_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_BRANCH_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_CLASS_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_COMPLEXITY_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_INSTRUCTION_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_LINE_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_MINIMUM_METHOD_COVERAGE): "0",
      (STAGE_RESULTS_JACOCO_SKIP_COPY_OF_SRC_FILES):false,
      (STAGE_RESULTS_JACOCO_SOURCE_PATTERN): "**/src/main/java",
    ],
    (STAGE_RESULTS_JUNIT) : [
      (STAGE_RESULTS_JUNIT_ENABLED) : true
    ],
    (STAGE_RESULTS_FINDBUGS) : [
      (STAGE_RESULTS_FINDBUGS_ENABLED) : true
    ],
    (STAGE_RESULTS_OPEN_TASKS) : [
      (STAGE_RESULTS_OPEN_TASKS_ENABLED) : true
    ],
    (STAGE_RESULTS_PMD) : [
      (STAGE_RESULTS_PMD_ENABLED) : true
    ],
  ]
)

_extend (optional)

Constant ConfigConstants.STAGE_RESULTS_EXTEND
Type Closure with signature (Map config, superImpl)
Default null

Use this configuration option to overwrite or extend the defaultResultsStage step.

Example:

import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*
import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*

def customResultsStage(Map config, superImpl) {
  echo "before defaultResultsStage stage"
  superImpl(config)
  echo "after defaultResultsStage stage"
}

defaultResultsStage(
  (STAGE_RESULTS) : [
    (STAGE_RESULTS_EXTEND) : this.&customResultsStage
  ]
)

enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_ENABLED
Type Boolean
Default true

Use this configuration option to enable (default) or disable the defaultResultsStage step.

checkstyle (optional)

Constant ConfigConstants.STAGE_RESULTS_CHECKSTYLE
Type Map

Configures the checkStyle tool of the Warnings Next Generation.

Checkstyle: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_CHECKSTYLE_ENABLED
Type Boolean

Enables/disables the checkStyle tool of the Warnings Next Generation.

Checkstyle: defaultEncoding (optional)

Constant ConfigConstants.STAGE_RESULTS_CHECKSTYLE_REPORT_ENCODING
Type String

Configure the reportEncoding for the checkStyle tool of the Warnings Next Generation.

Checkstyle: pattern (optional)

Constant ConfigConstants.STAGE_RESULTS_CHECKSTYLE_PATTERN
Type String
Default **/target/checkstyle-result*.xml

Configure the pattern for the checkStyle tool of the Warnings Next Generation.

findbugs (optional)

Constant ConfigConstants.STAGE_RESULTS_FINDBUGS
Type Map

Configures findBugs tool for Warnings Next Generation.

FindBugs: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_FINDBUGS_ENABLED
Type Boolean
Default true

Enables/disables findBugs tool for Warnings Next Generation Plugin.

fingerprint (optional)

Constant ConfigConstants.STAGE_RESULTS_FINGERPRINT
Type Map

Configures the fingerprinting of artifacts.

Fingerprint: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_FINGERPRINT_ENABLED
Type Boolean
Default true

Enables/disables the fingerprinting of artifacts.

Fingerprint: fileset (optional)

Constant ConfigConstants.STAGE_RESULTS_FINGERPRINT_FILESET
Type String
Default **/target/**/*.zip,**/target/**/*.jar

Configures the ANT fileset for the artifacts that should be fingerprinted.

jacoco (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO
Type Map

Configures the JaCoCo Plugin.

Jacoco: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_ENABLED
Type Boolean
Default true

Enables/disables JaCoCo Plugin.

Jacoco: buildOverBuild (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_BUILD_OVER_BUILD
Type Boolean
Default false

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: changeBuildStatus (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_CHANGE_BUILD_STATUS
Type Boolean
Default false

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: classPattern (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_CLASS_PATTERN
Type String
Default **/target/classes

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaBranchCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_BRANCH_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaClassCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_CLASS_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaComplexityCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_COMPLEXITY_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaInstructionCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_INSTRUCTION_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaLineCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_LINE_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: deltaMethodCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_METHOD_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: exclusionPattern (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_EXCLUSION_PATTERN
Type String
Default ""

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: execPattern (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_EXEC_PATTERN
Type String
Default **/target/**.exec

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: inclusionPattern (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_INCLUSION_PATTERN
Type String
Default ""

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumBranchCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_BRANCH_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumClassCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_CLASS_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumComplexityCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_COMPLEXITY_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumInstructionCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_INSTRUCTION_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumLineCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_LINE_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: maximumMethodCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_METHOD_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumBranchCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_BRANCH_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumClassCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_CLASS_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumComplexityCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_COMPLEXITY_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumInstructionCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_INSTRUCTION_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumLineCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_LINE_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: minimumMethodCoverage (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_METHOD_COVERAGE
Type String
Default "0"

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: skipCopyOfSrcFiles (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_SKIP_COPY_OF_SRC_FILES
Type Boolean
Default false

Please refer to the JaCoCo Plugin documentation for more details.

Jacoco: sourcePattern (optional)

Constant ConfigConstants.STAGE_RESULTS_JACOCO_SOURCE_PATTERN
Type String
Default **/src/main/java

Please refer to the JaCoCo Plugin documentation for more details.

junit (optional)

Constant ConfigConstants.STAGE_RESULTS_JUNIT
Type Map

Configures the JUnit Plugin.

JUnit: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_JUNIT_ENABLED
Type Boolean
Default true

Enables/disables JUnit Plugin and the junitPublisher tool for Warnings Next Generation Plugin.

openTasks (optional)

Constant ConfigConstants.STAGE_RESULTS_OPEN_TASKS
Type Map

Configures the taskScanner tool for Warnings Next Generation Plugin.

Open Tasks: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_OPEN_TASKS_ENABLED
Type Boolean
Default true

Enables/disables the taskScanner tool for Warnings Next Generation Plugin.

pmd (optional)

Constant ConfigConstants.STAGE_RESULTS_PMD
Type Map

Configures the pmd tool for Warnings Next Generation Plugin.

PMD: enabled (optional)

Constant ConfigConstants.STAGE_RESULTS_PMD_ENABLED
Type Boolean
Default true

Enables/disables the pmd tool for Warnings Next Generation Plugin.