The Mainframe_CI_Pipeline_from_Shared_Lib uses two external
.yml files, storing configuration information about the environment it is running in. Using Shared Library conventions, they reside in the
resources folder of the Shared Library folder structure. The files in question are
Both files are being read using the
libraryResource method, provided by Jenkins Shared Libraries and converted to
yaml objects using the
readYaml method, provided by the Pipeline Utility Steps plugin.
resources\pipelineConfig.yml file contains configuration settings about the 'environment' the Jenkins pipeline is executing in/for, i.e. URLs of servers like SonarQube or XL Release and others. It is being processed by:
configFile = 'pipelineConfig.yml' def pipelineConfig = readYaml(text: libraryResource(configFile))
pipelineConfig can then be used to access the configuration values, e.g.:
The content of the file is:
git: url: "https://github.com" tttRepoExtension: "_Total_Tests.git" branch: "master" sq: scannerName: "scanner" serverName: "localhost" xlr: template: "A Release from Jenkins" user: "admin" ttt: general: folder: "Tests" sonarResultsFolder: "./TTTSonar" sonarResultsFile: "generated.cli.suite.sonar.xml" virtualized: folder: "Virtualized_Tests" environment: "123456789012345678901234" targetSonarResults: "generated.cli.vt.suite.sonar.xml" nonVirtualized: folder: "Non_Virtualized_Tests" environment: "123456789012345678901234" targetSonarResults: "generated.cli.nvt.suite.sonar.xml" ces: url: "http://ces.url:2020" ispw: runtime: "ispw" changedProgramsFile: "changedPrograms.json" mfSourceFolder: "MF_Source"
To determine the appropriate values to use, refer to the description of the pipeline parameters
resources\mailList.yml file conatins a list of TSO user ID, mail address pairs.
After reading the file, the result can be used to retrieve the email address based on the owner of the ISPW container and send mail message to the desired recipient:
mailListFile = 'mailList.yml' def mailList = readYaml(text: libraryResource(mailListFile)) def mailRecipient = mailList[(pipelineParams.ispwOwner.toUpperCase())]