---
name: ContinuousDelivery-cli_publish_deploy
title: Publishing a deployment record
description: 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.
last-updated: 2022-03-25
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/ContinuousDelivery?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:tip: .tip}
{:note: .note}
{:important: .important}
{:pre: .pre}

# Publishing a deployment record
{: #publish-deploy-cli}

DevOps Insights will reach end of service and be discontinued on **August 31, 2026**. After this date, the service will no longer be available. New DevOps Insights tool integrations can no longer be created. [Learn more](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-faq_region_feature_consolidation&format=markdown)
{: important}

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. 
{: shortdesc}

## Before you begin
{: #prereq-deploy-cli}

[Publish a build record](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-publish-build-cli&format=markdown).

## Uploading a deployment record
{: #deploy-cli}

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. In the deployment job, use the following script to upload a deployment record. The `--env` flag identifies the deployment environment.

```bash
#!/bin/bash

#install the 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
ibmcloud login --apikey $API_KEY --no-region

ibmcloud doi deployrecord-publish --logicalappname="$MY_APP_NAME" --buildnumber="$MY_BUILD_NUMBER" --env staging --status pass
```
{: codeblock}

## Viewing deployment frequency
{: #deploy-frequency-cli}

When the deployment job completes, the pipeline publishes a message to DevOps Insights that the specified build and app was deployed. 

1. From the IBM Cloud console, click the menu icon ![hamburger icon](images/icon_hamburger.svg), and select **Resource List**.
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
{: #next-deploy-cli} 

[Publish test results](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-publish-test-cli&format=markdown).