2020-03-31 15:16:18 +02:00
|
|
|
import com.sap.piper.GenerateStageDocumentation
|
|
|
|
import com.sap.piper.ReportAggregator
|
|
|
|
import groovy.transform.Field
|
|
|
|
|
|
|
|
import static com.sap.piper.Prerequisites.checkScript
|
|
|
|
|
|
|
|
@Field String STEP_NAME = getClass().getName()
|
|
|
|
|
|
|
|
@Field Set GENERAL_CONFIG_KEYS = []
|
|
|
|
@Field Set STAGE_STEP_KEYS = []
|
2020-04-04 11:44:02 +02:00
|
|
|
@Field Set STAGE_CONFIG_KEYS = STAGE_STEP_KEYS
|
2020-03-31 15:16:18 +02:00
|
|
|
@Field Set PARAMETER_KEYS = STAGE_CONFIG_KEYS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This stage is responsible for releasing/deploying artifacts to a Nexus Repository Manager.<br />
|
|
|
|
*/
|
|
|
|
@GenerateStageDocumentation(defaultStageName = 'artifactDeployment')
|
|
|
|
void call(Map parameters = [:]) {
|
|
|
|
String stageName = 'artifactDeployment'
|
|
|
|
final script = checkScript(this, parameters) ?: this
|
|
|
|
|
|
|
|
piperStageWrapper(stageName: stageName, script: script) {
|
|
|
|
|
|
|
|
def commonPipelineEnvironment = script.commonPipelineEnvironment
|
|
|
|
List unstableSteps = commonPipelineEnvironment?.getValue('unstableSteps') ?: []
|
|
|
|
if (unstableSteps) {
|
|
|
|
piperPipelineStageConfirm script: script
|
|
|
|
unstableSteps = []
|
|
|
|
commonPipelineEnvironment.setValue('unstableSteps', unstableSteps)
|
|
|
|
}
|
|
|
|
|
|
|
|
withEnv(["STAGE_NAME=${stageName}"]) {
|
2020-04-04 11:44:02 +02:00
|
|
|
nexusUpload(script: script)
|
2020-03-31 15:16:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ReportAggregator.instance.reportDeploymentToNexus()
|
|
|
|
}
|
|
|
|
}
|