IBM Cloud Docs
Publishing a build record

Publishing a build record

Build records notify IBM Cloud® DevOps Insights when a build is complete. This record contains the application name, branch, build ID, reference to Git repo, and other fields. You must publish build records to view any test records, deployment records, or evaluate policies in DevOps Insights.

Before you begin

Set consistent parameter values.

Uploading a build record

In a build job, use the following script to upload a build record.

#!/bin/bash

#install the latest version of DevOps Insights plugin
ibmcloud plugin install -f doi

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

# $GIT_BRANCH, $GIT_URL, $GIT_COMMIT are environment variables made available by the Continuous Delivery pipeline
# Assumes you have set $MY_APP_NAME and $MY_BUILD_NUMBER as described earlier

ibmcloud doi buildrecord-publish --logicalappname="$MY_APP_NAME" --buildnumber="$MY_BUILD_NUMBER" --branch $GIT_BRANCH --repositoryurl $GIT_URL --commitid $GIT_COMMIT --status pass

The status field takes the values pass or fail.

Viewing the build frequency

When the build job completes, the pipeline publishes a message to DevOps Insights that a build is complete. You can view the build record on the Build Frequency page.

  1. From the IBM Cloud console, click the Menu icon hamburger icon > Resource list.
  2. Select your toolchain.
  3. From your toolchain's Overview page, on the IBM Cloud tools card, click DevOps Insights.
  4. Click Build Frequency in the navigation.

Next steps

Publish a deployment record.