2020-06-23 15:56:56 +02:00
|
|
|
void call(parameters) {
|
|
|
|
pipeline {
|
|
|
|
agent none
|
|
|
|
options {
|
|
|
|
skipDefaultCheckout()
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
|
|
|
|
stage('Init') {
|
|
|
|
steps {
|
2021-06-23 10:04:15 +02:00
|
|
|
abapEnvironmentPipelineStageInit script: parameters.script, customDefaults: ['com.sap.piper/pipeline/abapEnvironmentPipelineStageDefaults.yml'].plus(parameters.customDefaults ?: [])
|
2020-06-23 15:56:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-02 17:03:43 +02:00
|
|
|
stage('Initial Checks') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get("Build")}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageInitialChecks script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-23 15:56:56 +02:00
|
|
|
stage('Prepare System') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStagePrepareSystem script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Clone Repositories') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageCloneRepositories script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('ATC') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageATC script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
2020-10-02 17:03:43 +02:00
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageBuild script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Integration Tests') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageIntegrationTests script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Confirm') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get("Publish")}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStageConfirm script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish') {
|
|
|
|
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
|
|
|
|
steps {
|
|
|
|
abapEnvironmentPipelineStagePublish script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-23 15:56:56 +02:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
/* https://jenkins.io/doc/book/pipeline/syntax/#post */
|
|
|
|
success {buildSetResult(currentBuild)}
|
|
|
|
aborted {buildSetResult(currentBuild, 'ABORTED')}
|
|
|
|
failure {buildSetResult(currentBuild, 'FAILURE')}
|
|
|
|
unstable {buildSetResult(currentBuild, 'UNSTABLE')}
|
|
|
|
cleanup {
|
|
|
|
abapEnvironmentPipelineStagePost script: parameters.script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|