2020-10-02 17:03:43 +02:00
|
|
|
import groovy.transform.Field
|
|
|
|
import com.sap.piper.Utils
|
2022-11-22 12:10:10 +02:00
|
|
|
import com.sap.piper.ConfigurationHelper
|
2020-10-02 17:03:43 +02:00
|
|
|
|
|
|
|
import static com.sap.piper.Prerequisites.checkScript
|
|
|
|
|
|
|
|
@Field String STEP_NAME = getClass().getName()
|
|
|
|
@Field Set GENERAL_CONFIG_KEYS = []
|
|
|
|
@Field STAGE_STEP_KEYS = [
|
2022-11-22 12:10:10 +02:00
|
|
|
'abapEnvironmentAssemblyKitPublishTargetVector',
|
|
|
|
'testBuild' // Parameter for test execution mode, if true stage will be skipped
|
2020-10-02 17:03:43 +02:00
|
|
|
]
|
|
|
|
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus(STAGE_STEP_KEYS)
|
|
|
|
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
|
|
|
|
/**
|
2022-11-29 10:52:23 +02:00
|
|
|
* This stage publishes an AddOn for the SAP BTP ABAP Environment
|
2020-10-02 17:03:43 +02:00
|
|
|
*/
|
|
|
|
void call(Map parameters = [:]) {
|
|
|
|
def script = checkScript(this, parameters) ?: this
|
|
|
|
def stageName = parameters.stageName?:env.STAGE_NAME
|
|
|
|
|
2022-11-22 12:10:10 +02:00
|
|
|
Map config = ConfigurationHelper.newInstance(this)
|
|
|
|
.loadStepDefaults()
|
|
|
|
.mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS)
|
|
|
|
.mixinStageConfig(script.commonPipelineEnvironment, stageName, STEP_CONFIG_KEYS)
|
|
|
|
.mixin(parameters, PARAMETER_KEYS)
|
|
|
|
.addIfEmpty('testBuild', false)
|
|
|
|
.use()
|
2021-11-16 10:32:09 +02:00
|
|
|
|
2022-11-22 12:10:10 +02:00
|
|
|
if (config.testBuild) {
|
|
|
|
echo "Stage 'Publish' skipped as parameter 'testBuild' is active"
|
|
|
|
} else {
|
|
|
|
piperStageWrapper (script: script, stageName: stageName, stashContent: [], stageLocking: false) {
|
|
|
|
abapAddonAssemblyKitPublishTargetVector(script: parameters.script, targetVectorScope: 'P')
|
|
|
|
}
|
2020-10-02 17:03:43 +02:00
|
|
|
}
|
|
|
|
}
|