IBM Cloud Docs
Publishing a deployment record (deprecated)

Publishing a deployment record (deprecated)

You can publish a deployment record by using idra (deprecated) to integrate your Delivery Pipeline with DevOps Insights. Deployment records inform IBM Cloud® 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 idra (deprecated).

Publishing a deployment record (deprecated)

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

#!/bin/bash
# Add user api key to stage environment variable as a secured property
export LOGICAL_APP_NAME="SampleApp"
export BUILD_PREFIX="master"

# node 4.x or above is needed
export PATH=/opt/IBM/node-v4.2/bin:$PATH
npm install -g grunt-idra3

idra --publishdeployrecord --env=staging --status=pass

Environment variables that you define in the pipeline provide context for publishing these records. You can define them by using the export command in your jobs' scripts. You can also set them in each pipeline stage's Environment Properties menu.

Environment variable and purpose
Environment Variable Purpose Required
IBM_CLOUD_API_KEY The IBM Cloud user's API key. All jobs that start the idra CLI and enforce DevOps Insights risk policies.
LOGICAL_APP_NAME The app's name on the dashboard. All jobs that build, test, deploy, and enforce DevOps Insights risk policies.
BUILD_PREFIX Text that is added as a prefix to the stage's builds. This text also appears on the dashboard. All jobs that build, test, deploy, and enforce DevOps Insights risk policies.

Be sure to use these variables consistently:

  • The IBM_CLOUD_API_KEY is similar to a password; add it to each Continuous Delivery pipeline stage environment as a Secure property.
  • For a particular application, use the same LOGICAL_APP_NAME in all jobs or stages.
  • Make sure that the BUILD_PREFIX is the same for a particular app and build type. For example, for builds from the master branch, BUILD_PREFIX might be "master".

Viewing 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:

  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

Learn how to publish test results by using idra (deprecated).