---
schema_version: "1"
id: e5b55a912fdccd084a794ab325c3e9b4db084c2e8ebf8d2713eb73f81b1f8023
title: Build Tool with Salesforce DX (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_build_tool_salesforce_dx.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_build_tool_salesforce_dx.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b5293e54dbc915c1a5e442f92a0cff5c6b41b2caf3c22096e2f2e2e14591a311
description: For the managed package runtime, build Tool fits into an automated Salesforce build. Let’s look at a sample project.
products:
  - Omnistudio
release: "264"
---
# Build Tool with Salesforce DX (Managed Package)

For the managed package runtime, build Tool fits into an automated Salesforce build. Let’s look at a sample project.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

This project includes data packs in the vlocity\_components folder and a Salesforce DX project in the salesforce\_sfdx folder.

![Simple example project](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/os_build_simple_project.png)

Here’s an example shell script with Salesforce CLI commands and Build Tool:

```
# Use JWT Authorization flow for Jenkins / Automation Server - Additional info below
sf org login jwt --username "$DP_BT_HUB" --jwt-key-file "$DP_BT_JWT" --client-id "$DP_DT_CONNECTED" --set-default-dev-hub

# Change how long the Scratch Org will last. Max: 30
DURATION_DAYS=1

# Create Scratch Org if no Username provided as first argument to script. 
# Get Created Username using jq bash tool. 
# Can also just set "--alias ${JOB_NAME}_${JOB_NUMBER}" and use Alias as username in subsequent calls

if [ -z "$1" ]; then
    SCRATCH_ORG=`sf org create scratch --definition-file config/scratch.json --duration-days $DURATION_DAYS --json`
    SF_USERNAME=`echo $SCRATCH_ORG | jq -r '. | .result.username'`
else 
    SF_USERNAME=$1
fi

# Install or Update Managed Package
sf project deploy start --metadata-dir managed_packages/vlocity_package --wait -1 --target-org $SF_USERNAME

# Push Salesforce part of Project
sf project deploy start --target-org $SF_USERNAME

# Refresh Vlocity Base - Installs all the Vlocity Authored Vlocity Cards and Vlocity UI Templates
vlocity -sfdx.username $SF_USERNAME -job VlocityComponents.yaml refreshVlocityBase

# Deploy Vlocity folder
vlocity -sfdx.username $SF_USERNAME -job VlocityComponents.yaml packDeploy
```

The Vlocity managed package in the example is installed through the Metadata API with Salesforce DX. It’s stored at this path:

managed\_packages/vlocity\_package/installedPackages/vlocity\_cmt.installedPackage

The version of the package installed can be updated in this file:

```
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">
    <versionNumber>900.208.0</versionNumber>
</InstalledPackage>
```