Jenkins Environment Variables
The MettleCI Pipelines require the establishment of a set of input values which provide the information about your environment required to support the execution of the Pipeline’s steps. The MettleCI Pipeline derives these values from two sources
Jenkins Node Properties, which is accessed by selecting Jenkins → Manage Jenkins → Manage Nodes and Clouds → {your node’s cog icon}, and
Environment Variables (using the
environment {...}
syntax) defined at different scopes within the supplied sample Pipelines
Jenkins Node Properties
The values assumed to have been defined by MettleCI’s sample Jenkins Pipelines are as follows:
Property Name | Typical Value | Notes |
---|---|---|
AGENTMETTLECMD |
| The location of the Windows MettleCI command line interface ( |
AGENTMETTLEHOME |
| The location where temporary files are to be kept for the duration of the Jenkins build process.. |
ENGINEUNITTESTBASEDIR |
| The location of your MettleCI installation on your DataStage Engine tier. |
IISDOMAINNAME |
| Your DataStage Services tier and port. |
IISENGINENAME |
| Your DataStage Engine tier. |
IISUSERNAME |
| Your IIS user name. |
IISPASSWORD |
| The name of the Jenkins Credentials entry that contains your IIS user’s password for this node. See Protecting Sensitive Information used in Jenkins Pipelines for a detailed explanation. |
IISPROJECTTEMPLATEDIR |
| The location of the project Template directory on your DataStage Engine tier. |
MCIUSERNAME |
| The DataStage Engine tier user under which your MettleCI workbench is installed. |
MCIPASSWORD |
| The name of the Jenkins Credentials entry that contains your Engine tier’s MettleCI Workbench installation user’s password. See Protecting Sensitive Information used in Jenkins Pipelines for a detailed explanation. |
|
| The URL of the MettleCI Workbench server. |
You’ll see these values being used in various places within the supplied Pipeline templates. e.g.:
steps {
withCredentials([
string(credentialsId: "${env.IISPASSWORD}", variable: 'IISPASSWORD'),
string(credentialsId: "${env.MCIPASSWORD}", variable: 'MCIPASSWORD')
]) {
....
}
}
Note that despite the table above only listing passwords as being stored privately as Jenkins Credentials this process can be applied to any and all values that you use.
Pipeline Environment Variables
You’ll need to scan the supplied Pipelines for instances of the the environment {...}
keyword and replace the supplied values with values appropriate to your needs.
For example, the start of the Upgrade Pipeline defines some global Environment Variables:
environment {
IIS_BASE_PROJECT_NAME = 'wwi_jenkins_ds_115'
COMPLIANCE_REPO_CREDENTIALS = 'ComplianceRepoCredentials'
COMPLIANCE_REPO_URL = '<https://user@git.mettleci.io/compliance-rules.git'>
UPGRADE_ORACLE_VARIANT = true
UPGRADED_ORACLE_VERSION = 12
}
You’ll also see environment variables defined within Stages, some of which make use of global variables:
stage("Create DSParams Diff Artifact") {
agent {
label 'mettleci:datastage11.5.1'
}
environment {
ENVID = "ci"
DATASTAGE_PROJECT = "${env.IIS_BASE_PROJECT_NAME}_${env.ENVID}"
}
etc...
© 2015-2024 Data Migrators Pty Ltd.