Publishing a deployment record
You can publish a deployment record by using Jenkins to integrate your projects with IBM Cloud® DevOps Insights. Deployment records inform DevOps Insights about the deployments that are made during the deployment process. This record contains the application name, build ID, environment name, status of the deployment, and more. The application name and build ID in the deployment record must match the ones that are used in the build record for a specific build.
Before you begin
Before you publish a deployment a record, you must publish a build record. For more information, see Publishing a build record by using Jenkins.
Publishing a deployment record
Publish deployment records with the publishDeployRecord step. This step requires two parameters. It can also accept two of the three optional parameters.
Parameter | Definition |
---|---|
environment |
The environment to which you deploy your app, like DEV or STAGING or any other value. |
result |
The result of the build stage. The value is either SUCCESS or FAIL . |
appUrl |
Optional: The URL used to access your application. |
buildNumber |
Optional: The set value to any string that represents version number. |
applicationName |
Optional: Set the application name. If this value is set, the environment variable IBM_CLOUD_DEVOPS_APP_NAME is ignored. |
The following example commands include the parameters. The first command publishes the deployment record for a staging environment. The second command publishes the deployment record for a production environment.
publishDeployRecord environment: "STAGING", appUrl: "http://staging-Weather-App.mybluemix.net", result:"SUCCESS"
publishDeployRecord environment: "PRODUCTION", appUrl: "http://Weather-App.mybluemix.net", result:"SUCCESS"
For each command, you need to specify the toolchain ID to export the environment variable. For more information, see Environment variables and definitions.
Viewing the deployment frequency
When the deployment job completes, the pipeline publishes a message to DevOps Insights that the specified build and app was deployed. You can view the deployment record on the Deployment Frequency page. To view the Deployment Frequency page, use the following steps:
- From the IBM Cloud console, click the Menu icon > Platform Automation > Toolchains.
- Select your toolchain.
- From your toolchain's Overview page, on the IBM Cloud tools card, click DevOps Insights.
- Click Deployment Frequency.
Next steps
Publish test results by using Jenkins.