IBM Cloud Docs
Publishing a deployment record

Publishing a deployment record

You can publish a deployment record by using other continuous integration and continuous delivery (CI/CD) tools with the IBM Cloud® command line interface (CLI) to integrate 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 about publishing a build record, see Publishing a build record by using other CI/CD tools.

Publishing a deployment record for Continuous Delivery

In the deployment job, use the following script to upload a deployment record. The --env flag identifies the deployment environment. Use the deployrecord-publish command to upload a deployment record.

#!/bin/bash

#install the DevOps Insights plugin
ibmcloud plugin install -f doi

# Log in to IBM Cloud if you are not already logged in.  Assumes that $API_KEY environment variable has been set as a secured property
ibmcloud login --apikey $API_KEY --no-region

ibmcloud doi deployrecord-publish --logicalappname="$MY_APP_NAME" --buildnumber="$MY_BUILD_NUMBER" --env staging --status pass

Providing a job url to upload deployment records

Provide a joburl to upload deployment records. To include joburl as a parameter to upload a deployment record, pass it in as a parameter:

ibmcloud doi deploymentrecord-publish --logicalappname "$MY_APP_NAME" --buildnumber "$MY_BUILD_NUMBER" --env staging --joburl "$JOB_URL" --status pass

Viewing Deployment Frequency

When the deployment job completes, your CI/CD tool 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:

  1. From the IBM Cloud console, click the Menu icon hamburger icon > Platform Automation > Toolchains.
  2. Select your toolchain.
  3. From your toolchain's Overview page, on the IBM Cloud tools card, click DevOps Insights.
  4. Click Deployment Frequency.

Next steps

Publish test results by using other CI/CD tools.