Salesforce partners and ISVs can use scratch orgs as their dev environments when building managed second-generation (2GP) extension packages that expand the functionality of DevOps Center. An extension is any package, component, or set of components that adds to the functionality of a managed package. An extension requires that the base managed package is installed in the org.
Required Editions
| User Permissions Needed | |
|---|---|
| To install and configure DevOps Center: | “Download AppExchange Packages” |
| To create packages: | “Create AppExchange Packages” |
| To upload packages: | “Upload AppExchange Packages” |
Use this high-level work flow as a guide for using a scratch org as your development environment when building an extension package.
- Enable DevOps Center in your Dev Hub org.
-
Update the scratch org definition file to enable DevOps Center, and then use this
definition file when creating scratch orgs and package versions.
{ "orgName": "Acme", "edition": "Enterprise", "features": ["DevOpsCenter"], "settings": { "devHubSettings": { "enableDevOpsCenterGA": true } } }If creating a scratch org based on an org shape, you still have to include the DevOps Center feature and settings in the scratch org definition file for legal reasons as part of the DevOps Center terms and conditions.
{ "orgName": "Acme", "sourceOrg": "00DB1230400Ifx5", "features": ["DevOpsCenter"], "settings": { "devHubSettings": { "enableDevOpsCenterGA": true } } } -
Update the sfdx_project.json file to include the DevOps Center
base package as a dependency.
You can also reference the definition file or indicate it on the command line later during package version creation. See the example files in Project Configuration File for a Second-Generation Managed Package in the Second-Generation Managed Packaging Developer Guide.
-
In the scratch org, from the DevOps Center Setup page, install the DevOps Center
package.
To use Salesforce CLI to install the package in additional scratch orgs, note the package ID, which starts with
04t. - After you have finished developing your extension package, use Salesforce CLI to create a package.
-
When you’re ready to test or release the package, create a package version.
If you didn’t include the definition file in the sfdx_project.json project file, be sure to indicate it on the command line. For example:
sf package version create --package "Agile Addon " --definition-file config/project-scratch-def.json \ --installation-key test1234 --wait 10