Scratch Org Wizard
If you are new to Copado DX, please check out the article Getting Started with Copado DX.
If you have already completed the first steps in the getting started path and have followed the instructions provided in the article Set Up Your Developer Hub to enable an org credential as dev hub, you can go ahead and start creating your scratch org.
Copado’s scratch org wizard allows you to easily set up your scratch org. Let’s take a look at the step-by-step process:
- First of all, create a user story with an empty org credential. This field will be populated later on with the credentials of the scratch org:
- From the drop-down menu at the top-right corner of the page, click on Scratch Org Wizard to launch the wizard:
- The first stage is to load the metadata. Select Unlocked Packages from the available metadata source options:
- On the next screen, fill in the relevant details and select a package:
- Select the org credential with which the package is associated.
- Select an API version.
- If you have a custom domain, include it in the SFDC Login Url field.
- Add a namespace if you would like your scratch org to have one. Please note this field is not required for unlocked packages.
- Select the package you want to add to your scratch org. This is a multi-select picklist field, so you can select more than one package.
If you have not created a package yet, follow the steps provided in the article Creating an Unlocked Package to create one.
- Select a package version and click on Add to Selection:
- Click on Next at the top right corner to move on to the next stage in the wizard.
- At this stage, you need to set up your scratch org definition template:
- If you don’t have any pre-configured org definition template, leave this field blank and fill in your template details.
- Give your org definition template a name.
- Select the dev hub org that will be used to manage the scratch org and the Salesforce edition of the org.
- The Org Name field will be autopopulated.
- Set a duration for your scratch org. The default value is 7 days, and the maximum duration allowed is 30 days.
- You don’t need to provide any other details at this stage. However, if you want to create an org which includes certain features, scroll down to the Definition section and create a definition JSON file with the features you would like to include:For more details about the information included in this section, please refer to the article Scratch Org Definition Details.
- Once you are done, click on Save As Template if you want to reuse this template in the feature, or click on Next to proceed to the next stage.
- You are now at the Extensions stage. Here, you can configure actions that will be executed once the scratch org is created, such as assigning permission sets. If you don’t want to add anything else, click on Next to go to the next stage. Otherwise, follow these steps:
- Create a standalone deployment in a separate tab with a source org and no destination.
- Add a deployment step with the action you would like to execute. If you want to assign permission sets, you can use an Apex step.
- Save the deployment.
- Back in the scratch org wizard, select the source org used in the deployment in the Source Org lookup field:
- Next, select the deployment you have created in the field Select a Job Template and click on Add to extensions:
- Once you are done, click on Next to continue.
- At the last stage of the wizard you can review and validate the parameters you have added to your scratch org and ensure everything looks right:
- Click on Complete Setup to finalize the creation of your scratch org.