Combined scenario
Calling script Mainframe_Combined_Pipeline
The Jenkins job is configured to use the initial script Mainframe_Combined_Pipeline.jenkinsfile from src/Jenkiksfile folder in the Git underlying the Shared Library, similar to the loading the script from GitHub for the basic pipeline.
The code will determine the Code Pipeline operation triggering the pipeline from the ISPW_Operation parameter, which gets its value from the webhook via the $$operation$$ parameter. Based on the value of ISPW_Operation it will:
- call/execute Mainframe_Generate_Pipeline if the value is 'Generate'
- call/execute Mainframe_Generate_Pipeline if the value is 'Promote'
- stop execution, if the value is none of the above
def parmMap = [
...
]
switch(ISPW_Operation) {
case 'Generate':
currentBuild.displayName = BUILD_NUMBER + ": Code Generation"
Mainframe_Generate_Pipeline(parmMap)
break;
case 'Promote':
currentBuild.displayName = BUILD_NUMBER + ": Code Promotion"
Mainframe_Integration_Pipeline(parmMap)
break;
default:
echo "Unsupported operation " + ISPW_Operation
echo "Review your Webhook settings"
break;
}
The parmMap is the same Map of parameters used for the simple Shared Library example.
Setting the currentBuild.displaName property allows distinguishing the different operations the pipeline job is executed for:
Mainframe_Generate_Pipeline
This pipeline is supposed to be executed every time (COBOL) components get generated within Code Pipeline. It will:
- download those COBOL components that are part of the set resulting from the generate
- retrieve Total Test tests from a GitHub repository for the corresponding stream and application
- execute those virtualized test scenarios that correspond to the downloaded components
- retrieve the Code Coverage results from the Code Coverage repository
- send sources, test results and coverage metrics to SonarQube
- query the results of the corresponding SonarQube quality gate
- send a mail message to the owner of the set, informing them of the status of the quality gate
Mainframe_Integration_Pipeline
This pipeline is supposed to be executed every time (COBOL) components get promoted within Code Pipeline. It will:
- download those COBOL components that are part of the assignment, for which the promote was executed
- retrieve Total Test tests from the same GitHub repository for the corresponding stream and application
- execute all non virtualized test scenarios
- send sources and test results SonarQube
- query the results of the corresponding SonarQube quality gate
- if the quality gate was passed, it will trigger an XLRelease release template to orchestrate the following CD process
- send a mail message to the owner of the set informing them of the status of the quality gate