mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
a035690f3d
This change updates the Cloud SDK stage defaults, makes the piperPipelineStageMavenStaticCodeChecks use the step condition and adds the onlyRunInProductiveBranch configuration option to npmExecuteEndToEndTests step.
49 lines
1.7 KiB
Groovy
49 lines
1.7 KiB
Groovy
import com.sap.piper.ConfigurationHelper
|
|
import com.sap.piper.GenerateDocumentation
|
|
import com.sap.piper.Utils
|
|
|
|
import static com.sap.piper.Prerequisites.checkScript
|
|
|
|
import groovy.transform.Field
|
|
|
|
@Field String STEP_NAME = getClass().getName()
|
|
|
|
@Field STAGE_STEP_KEYS = [
|
|
/** Executes static code checks for Maven based projects. The plugins SpotBugs and PMD are used. */
|
|
'mavenExecuteStaticCodeChecks'
|
|
]
|
|
@Field Set GENERAL_CONFIG_KEYS = []
|
|
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus(STAGE_STEP_KEYS)
|
|
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
|
|
|
|
/**
|
|
* Execute static code checks for Maven based projects. This stage enforces SAP Cloud SDK specific PND rulesets as well as SpotBugs include filter.
|
|
*
|
|
*/
|
|
@GenerateDocumentation
|
|
void call(Map parameters = [:]) {
|
|
final script = checkScript(this, parameters) ?: null
|
|
|
|
def utils = parameters.juStabUtils ?: new Utils()
|
|
|
|
def stageName = parameters.stageName?:env.STAGE_NAME
|
|
|
|
Map config = ConfigurationHelper.newInstance(this)
|
|
.loadStepDefaults()
|
|
.mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS)
|
|
.mixinStageConfig(script.commonPipelineEnvironment, stageName, STEP_CONFIG_KEYS)
|
|
.mixin(parameters, PARAMETER_KEYS)
|
|
.addIfEmpty('mavenExecuteStaticCodeChecks', script.commonPipelineEnvironment.configuration.runStep?.get(stageName)?.mavenExecuteStaticCodeChecks)
|
|
.use()
|
|
|
|
piperStageWrapper(stageName: stageName, script: script) {
|
|
|
|
// telemetry reporting
|
|
utils.pushToSWA([step: STEP_NAME], config)
|
|
|
|
if (config.mavenExecuteStaticCodeChecks) {
|
|
mavenExecuteStaticCodeChecks(script: script)
|
|
}
|
|
}
|
|
}
|