Deploying a Branch

Deployment pushes your branch’s metadata components into a target Salesforce org. It deploys actually applies changes, making it the final step in moving code/config into Salesforce environments.

Overview

Deploying a branch lets you migrate metadata components from a Cloud DevOps branch to a Salesforce Organization that is connected to DevOps.

The deployment process ensures that:

  • Selected branch components are applied to the target org

  • Optional destructive changes can remove metadata no longer needed

  • Apex tests and post-deployment steps run for compliance and stability

By running a deployment after validation, you can confidently promote changes to higher environments such as UAT and Production.

circle-info

Before deploying, conduct a validation job using the branch, components, and organization intended for deployment. Ensure the validation is successful before proceeding. For detailed validation instructions, refer to the following article.

circle-info

Best Practices

  • Always validate before deploying into UAT or Production.

  • Use Pre and Post destructive changes carefully; confirm items are safe to delete.

  • In production environments, always select Run all tests or Run local tests. In lower environments, you can select Do not run tests to enable faster deployments.

  • Use Profile/Permission Set scoping to avoid unnecessary overwrites.

  • Review logs carefully after deployment to confirm success.

  • Leverage Rollback immediately if unexpected issues occur.

Run Banch Deployment Job

1

Select a Branch and Start Deployment

  1. Click Code from the left sidebar menu.

  2. Select a branch from the list.

  3. Click Deploy.

2

Select Components and Organization

  1. Click Add for each branch component to include in the deployment.

  2. (Optional) Click Add all to add all components to the deployment.

  3. Click Next.

  4. Click Select to choose the Salesforce organization for deployment.

  5. Click Next.

3

Select Destructive Changes

Components can be marked for Pre (delete before deploy) or Post (delete after deploy).

circle-info

By default, all pre- and post-destructive changes are added.

  1. (Optional) To remove a destructive change from the deployment, click Added to unselect the component.

  2. Click Next.

4

Configure and Run Deployment

  1. Click the Run tests dropdown menu to choose the level of Apex testing to perform. See the table below for a description of each.

Test Level
Description

Default

Runs only the tests included in the package.

Do not run tests

Skips all Apex tests (allowed only in non-production orgs).

Run local tests

Executes all tests in the org except those from installed managed packages.

Run all tests

Runs every test in the org, including managed package tests.

Run specified tests

Lets you define individual test classes or methods to run.

  1. Click the deployment settings toggles to enable the settings. See the following table for an explanation of each setting.

Setting
Description

Deploy profile settings only for selected components

Only validate Profile Settings for the components you chose to include in this validation job.

Deploy permission set settings only for selected components

Only validate Permission Set Settings for the components you chose to include in this validation job.

Run post deploy Apex code

Executes defined Apex scripts after deployment completes. When enabled a text is availble for entering scripts.

Ignore warnings on deployment

Allows deployment to continue even with warnings.

Vlocity LWC Activation

When enabled, Vlocity Lightning Web Components are automatically activated, compiled, and made runnable during deployment.

  1. Click Run to start the Deployment job.

  2. After starting the Deployment job, it will be displayed on the Activities tab.

5

In Progress Deployment

During a Deploy job that is In Progress, you can monitor its status and cancel it if needed.

  1. Click the In Progress Deploy job.

Refresh Logs

  1. Click Refresh to refresh the log view with the current log.

Abort Deployment

  1. Click Abort.

  2. Click Abort in the Abort Deploy confirmation dialog.

  3. The Deploy job has stopped, and no further actions will be performed on the Salesforce Organization.

Deployment Results

1

View Results

  1. Click the Activities tab.

  2. Check that the Deploy job status is Completed

circle-info

If an error occurs during the Deploy job, its status will change to Exception. Review the Deploy job log to identify the errors.

Job Status
Description

Queued

Job is created and waiting to run.

In Progress

Job is running.

Completed

Job completed successfully.

Exception

Job completed with errors.

  1. Click the Deploy job.

  2. The Deploy results page lists job information and a detailed log.

2

Review Log (No Errors)

In the Deploy job log, details include:

  • Presence of Destructive Changes objects.

  • Count and list of deployed components.

  • Type and results of the Apex test run.

  • Deployment steps completed.

3

Review Log (With Errors)

When a Deploy job encounters an error, examine the logs to identify the cause. Focus on entries marked with [error]. The screenshots below show a Deploy job run in which a Salesforce org is missing multiple components required by the branch.

4

Rollback Deployment

On the deployment results page, if a backup was created, you will see a Rollback button. Clicking Rollback restores the organization to its state before the deployment, using the backup snapshot. For detailed instructions on this process, refer to the following article.

Last updated

Was this helpful?