From 1d1bf68d9644c8b45e3bc3e69524c0ab9b925287 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> Date: Wed, 24 Jun 2020 08:21:41 +0200 Subject: [PATCH] fix(security): remove duplicate stage wrapper (#1707) * remove duplicate stage wrapper fixes #1705 * Update piperPipelineStageSecurity.groovy * fix trailing spaces --- vars/piperPipelineStageSecurity.groovy | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/vars/piperPipelineStageSecurity.groovy b/vars/piperPipelineStageSecurity.groovy index a1af99913..973a3040b 100644 --- a/vars/piperPipelineStageSecurity.groovy +++ b/vars/piperPipelineStageSecurity.groovy @@ -25,12 +25,13 @@ import static com.sap.piper.Prerequisites.checkScript */ @GenerateStageDocumentation(defaultStageName = 'Security') void call(Map parameters = [:]) { - def script = checkScript(this, parameters) ?: this def utils = parameters.juStabUtils ?: new Utils() def stageName = parameters.stageName?:env.STAGE_NAME + def securityScanMap = [:] + Map config = ConfigurationHelper.newInstance(this) .loadStepDefaults() .mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS) @@ -40,11 +41,7 @@ void call(Map parameters = [:]) { .addIfEmpty('fortifyExecuteScan', script.commonPipelineEnvironment.configuration.runStep?.get(stageName)?.fortifyExecuteScan) .addIfEmpty('whitesourceExecuteScan', script.commonPipelineEnvironment.configuration.runStep?.get(stageName)?.whitesourceExecuteScan) .use() - piperStageWrapper (script: script, stageName: stageName) { - - def securityScanMap = [:] - if (config.checkmarxExecuteScan) { securityScanMap['Checkmarx'] = { node(config.nodeLabel) { @@ -87,14 +84,11 @@ void call(Map parameters = [:]) { } } - if (securityScanMap.size() > 0) { - piperStageWrapper (script: script, stageName: stageName) { - // telemetry reporting - utils.pushToSWA([step: STEP_NAME], config) + // telemetry reporting + utils.pushToSWA([step: STEP_NAME], config) - parallel securityScanMap.plus([failFast: false]) - } + parallel securityScanMap.plus([failFast: false]) } } }