1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/vars/abapEnvironmentPipeline.groovy

94 lines
3.8 KiB
Groovy
Raw Normal View History

2020-06-23 15:56:56 +02:00
void call(parameters) {
pipeline {
agent none
options {
skipDefaultCheckout()
}
stages {
stage('Init') {
steps {
abapEnvironmentPipelineStageInit script: parameters.script, customDefaults: ['com.sap.piper/pipeline/abapEnvironmentPipelineStageDefaults.yml'].plus(parameters.customDefaults ?: [])
2020-06-23 15:56:56 +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
}
}
A unit step integration (#3120) * Add AUnit stage * Add AUnit stage to ABAP Pipeline * Add Groovy Tests * surround header with space line * correct class name * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * adapt Pipeline Tests * Update tests & docu * adapt tests * Fix Pipeline Tests * adapt tests * Adapt tests * Adapt tests * docu fixes * Adapt tests * Improve Tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt host config * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * Adapt tests * adapt docu links * adapt docu links * adapt docu links * adapt docu links * Add example to config docu * change docu * Change host check * Adapt tests * Add Prepare System defaults * Change Prepare System defaults * return after writing xml results * change logging * return after results have been persisted * Change host check * echo test * echo test * echo test * echo test * echo test * config host checker working * Enable host groovy test * remove duplicates * docu extension AUnit extension stage * Remove trailing spaces * package restrictions added to docu * correct to type * correct type aunit tests * add capital letters to docu examples * remove escape * adapt unit tests Co-authored-by: Daniel Mieg <daniel.mieg@sap.com> Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-11 16:10:14 +02:00
stage('Test') {
parallel {
stage('ATC') {
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
steps {
abapEnvironmentPipelineStageATC script: parameters.script
}
}
stage('AUnit') {
when {expression {return parameters.script.commonPipelineEnvironment.configuration.runStage?.get(env.STAGE_NAME)}}
steps {
abapEnvironmentPipelineStageAUnit script: parameters.script
}
}
}
2020-06-23 15:56:56 +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
}
}
}
}