Using BMC AMI DevOps as part of a pipeline
You can use BMC AMI DevOps features in the following types of pipelines:
- Scripted Pipelines
- Declarative Pipelines using other jobs (projects)
For sample pipeline, see Sample pipeline scripts for Jenkins.
Important
When configuring a pipeline that uses multiple projects, ensure that the value you define for the JOB_ID parameter is the same in the pipeline and all of the projects.
For more information, view the Quick Course BMC AMI DevOps for Db2 - Building a Pipeline - Part 2. |
BMC AMI DevOps environment variables
BMC AMI DevOps provides the following environment variables for pipelines. You can use these variables in your pipeline script to control the flow of pipeline steps.
Variable | Description |
---|---|
BMC_SCHEMA_IDENTICAL | This variable provides the status of the comparison that the BMC AMI DevOps Schema Mgmt for Db2 - Schema Change Migration build step performs. This variable has one of the following values:
|
BMC_SCHEMA_RC | This variable provides a four digit return code for the BMC AMI DevOps Schema Mgmt for Db2 - Schema Change Migration build step. For Example, 0004, 0008 etc. |
BMC_SCHEMA_STANDARDS_RC | This variable provides a four digit return code for the BMC AMI DevOps Schema Mgmt for Db2 - Schema Standards build step. For Example, 0004, 0008 etc. |
BMC_EXEC_RC | This variable provides a four digit return code for the BMC AMI DevOps Common - JCL Execution build step. For Example, 0004, 0008 etc. |
BMC_GENERATE_JCL_ONLY | This variable has one of the following values:
|
BMC_SKIP_COMPARE | This variable has one of the following values:
|
Using BMC AMI DevOps environment variables in your pipeline script
This topic describes how:
- To retrieve and reset BMC AMI DevOps environment variable values
- To provide permission to use BMC AMI DevOps environment variables and methods
Before you begin
- For prerequisite plug-ins that you must install to use BMC AMI DevOps features in pipelines, see Planning.
- Before using BMC AMI DevOpsenvironment variables in your pipeline script, you must import the following static packages into the script:
import static com.bmc.db2.bmcclient.BMCClientCN.bmcCN;
import static com.bmc.db2.bmcclient.BMCClientSM.bmcSM;
To retrieve and reset BMC AMI DevOps environment variable values
You can use the following methods to retrieve and reset the values of the BMC AMI DevOps environment variables respectively:
get(String arg)
getRC(String arg)
reset(String arg)
In the get, getRC, and reset methods, you can pass BMC AMI DevOps environment variables as string arguments.
See the following examples:
To provide permission to use BMC AMI DevOps environment variables and methods
To use BMC AMI DevOps environment variables in your pipeline script, you must explicitly approve the following methods and variables:
method com.bmc.db2.bmcclient.BMCClientCN getRC java.lang.String
method com.bmc.db2.bmcclient.BMCClientCN reset java.lang.String
method com.bmc.db2.bmcclient.BMCClientSM get java.lang.String
method com.bmc.db2.bmcclient.BMCClientSM getRC java.lang.String
method com.bmc.db2.bmcclient.BMCClientSM reset java.lang.String
staticField com.bmc.db2.bmcclient.BMCClientCN bmcCN
staticField com.bmc.db2.bmcclient.BMCClientSM bmcSM
When you build a pipeline, it first fails and displays a message with a link to the In-process Script Approval section in Jenkins. Click the link and approve the method or variable. See the following example:
Comments
Log in or register to comment.