1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/vars/abapEnvironmentPipelineStageInit.groovy
Daniel Mieg ccdedd4599
Add stage defaults (#2841)
* Add stage defaults

* Adapt defaults

* Change default file

* Rename config files

* Add defaults for Build stage

* Change and escape cfServiceKeyConfig

* Remove service key config

* Fix typo

* Change quotes

* Add default for Publish

* Add cfDeleteServicesKeys to defaults
2021-06-23 10:04:15 +02:00

41 lines
1.7 KiB
Groovy

import groovy.transform.Field
import com.sap.piper.ConfigurationHelper
import com.sap.piper.ConfigurationLoader
import static com.sap.piper.Prerequisites.checkScript
@Field String STEP_NAME = getClass().getName()
@Field Set GENERAL_CONFIG_KEYS = []
@Field STAGE_STEP_KEYS = []
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus(STAGE_STEP_KEYS)
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
/**
* This stage initializes the ABAP Environment Pipeline run
*/
void call(Map parameters = [:]) {
def script = checkScript(this, parameters) ?: this
def stageName = parameters.stageName?:env.STAGE_NAME
piperStageWrapper (script: script, stageName: stageName, stashContent: [], stageLocking: false, ordinal: 1, telemetryDisabled: true) {
checkout scm
setupCommonPipelineEnvironment script: script, customDefaults: parameters.customDefaults
// load default & individual configuration
Map config = ConfigurationHelper.newInstance(this)
.loadStepDefaults()
.addIfEmpty('stageConfigResource', 'com.sap.piper/pipeline/abapEnvironmentPipelineStages.yml')
.addIfEmpty('stashSettings', 'com.sap.piper/pipeline/abapEnvironmentPipelineStashSettings.yml')
.withMandatoryProperty('stageConfigResource')
.use()
Map stashConfiguration = readYaml(text: libraryResource(config.stashSettings))
if (config.verbose) echo "Stash config: ${stashConfiguration}"
script.commonPipelineEnvironment.configuration.stageStashes = stashConfiguration
//handling of stage and step activation
piperInitRunStageConfiguration script: script, stageConfigResource: config.stageConfigResource
}
}