2019-01-15 14:32:01 +02:00
|
|
|
import static com.sap.piper.Prerequisites.checkScript
|
|
|
|
|
|
|
|
import groovy.transform.Field
|
|
|
|
|
|
|
|
@Field def STEP_NAME = getClass().getName()
|
|
|
|
|
|
|
|
@Field def GENERAL_CONFIG_KEYS = []
|
|
|
|
@Field def PARAMETER_KEYS = []
|
|
|
|
@Field def STEP_CONFIG_KEYS = []
|
|
|
|
|
|
|
|
/** The Scenario is intended for building and uploading a fiori application.
|
|
|
|
*
|
|
|
|
* It needs to be called from a pipeline script (Jenkinsfile) like:
|
|
|
|
* ```
|
|
|
|
* @Library('piper-lib-os') _
|
|
|
|
* @Library('your-additional-lib') __ // optional
|
|
|
|
*
|
|
|
|
* // parameter 'customDefaults' below is optional
|
|
|
|
* fioriOnCloudPlatformPipeline(script: this, customDefaults: '<configFile>')
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
void call(parameters = [:]) {
|
|
|
|
|
|
|
|
checkScript(this, parameters)
|
2023-07-07 14:35:14 +02:00
|
|
|
if(parameters.utils != null) parameters.juStabUtils = parameters.utils //named differently in steps
|
2019-01-15 14:32:01 +02:00
|
|
|
|
|
|
|
node(parameters.label) {
|
|
|
|
|
|
|
|
//
|
|
|
|
// Cut and paste lines below in order to create a pipeline from this scenario
|
|
|
|
// In this case `parameters` needs to be replaced by `script: this`.
|
|
|
|
|
|
|
|
stage('prepare') {
|
|
|
|
|
2019-03-21 11:19:49 +02:00
|
|
|
deleteDir()
|
|
|
|
checkout scm
|
2019-01-15 14:32:01 +02:00
|
|
|
setupCommonPipelineEnvironment(parameters)
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('build') {
|
|
|
|
|
|
|
|
mtaBuild(parameters)
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('deploy') {
|
|
|
|
|
2020-10-15 13:29:52 +02:00
|
|
|
def mtaBuildCfg = parameters.script.commonPipelineEnvironment.getStepConfiguration('mtaBuild', '')
|
|
|
|
|
|
|
|
if((mtaBuildCfg.platform == 'NEO') || (mtaBuildCfg.buildTarget == 'NEO')) {
|
|
|
|
neoDeploy(parameters)
|
|
|
|
}
|
|
|
|
else if((mtaBuildCfg.platform == 'CF') || (mtaBuildCfg.buildTarget == 'CF')) {
|
|
|
|
cloudFoundryDeploy(parameters)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
error "Deployment failed: no valid deployment target defined! Find details in https://sap.github.io/jenkins-library/steps/mtaBuild/#platform"
|
|
|
|
}
|
2019-01-15 14:32:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Cut and paste lines above in order to create a pipeline from this scenario
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|