Skip to main content
All CollectionsSetting up Hutte
Setting up a Scratch Org project
Setting up a Scratch Org project

Learn everything you need to get started with managing your trail and journey with Salesforce DX Scratch Orgs from Hutte.

Harald Mayer avatar
Written by Harald Mayer
Updated over a week ago

You’ll be up and running in a few minutes. All you need to do is follow our simple four steps to get started.

1. (required) Connect a Salesforce Org as your DevHub

Connect a Salesforce Production Org and enable DevHub from the "Setup Menu". If you don't have access to a Production Org, you can create Trailhead Playground (Hands-on) Orgs with a quota of five Scratch Orgs per org for free.

2. (required) Connect a Git repository

The connected repo needs to contain a valid sfdx project. If you only begin with SFDX – and you don't have a project yet – you can easily create one by running the command sf project create --projectname "Name" in an empty directory. You can then commit the created ‘file and folder’ structure. Alternatively, you can begin with our project template. In addition to an SFDX project, it includes an exemplary hutte.yml and simple CI/CD templates for use with GitHub Actions.

3. (optional) Shape your Scratch Org Definition to your project's needs

In Hutte, under "Project Settings" and "Default configuration for Scratch Orgs", you can store and edit the "Org Shape" for your Scratch Orgs. If you're already using SFDX, you'd likely copy the content of your config/project-scratch-def.json there. You can use {current_user} for adminEmail and {org_name} for orgName to dynamically set those values for every Scratch Org created from Hutte.

4. (optional) Add Hutte configuration to your Git repository: hutte.yml

Create an empty file in the root directory of your connected Git repository and name it hutte.yml. To get started, copy defaults from selecting "Configuration" in your Hutte project. You can gradually enhance it:

  • To add more automation when creating your Scratch Orgs

  • When you pull a source from them or work with them in your development process.

Make sure to merge your hutte.yml to your main branch to become effective for all Scratch Orgs created from that branch via Hutte.

Get inspiration for crafting your hutte.yml from the Recipes section within Hutte.

The Anatomy of hutte.yml:

setup_script (optional): Contains whatever you want to run directly after your Scratch Org. It is also useful if you want to have a different Setup behaviour for regular Scratch Orgs (created from "New Scratch Org") and Pool Orgs: Pool Orgs stop after setup_script, while regular Scratch Orgs will execute setup_script first, followed by push_script.

push_script (required): Runs after "setup_script". It is typically used to push your project's source, assign permission sets, load seed data, etc.

custom_scripts (optional): Each entry is exposed as additional buttons on the respective detail view of Sandbox Features or Scratch Orgs in Hutte (place under scratch_org: or sandbox: accordingly). This feature is excellent for non-mandatory, time-consuming actions that are not required with every Scratch Org of your project. For example, loading an immense amount of test data.

Example hutte.yml
This is a very simple hutte.yml, which adds one Custom Button for loading seed data to the detail view, leveraging the open source SF Plugin SFDMU - both for projects of type Scratch Org and Sandbox:

Download example hutte.yml here.

version: 1.0

# Shell script to run when pushing the source code to the scratch orgs.
# It's a great place to automate tasks like permission set assignments or data loading.
push_script: |
sf project deploy start --wait 60 --ignore-conflicts
sf project deploy start --wait 15 --ignore-conflicts --source-dir post-deploy
custom_scripts:
# This scripts will be displayed on the scratch org's page
scratch_org:
'Import seed data':
description: Import seed data into your Scratch Org
run: |
echo y | sf plugins install sfdmu
sf sfdmu run -p config/data -s csvfile -u "${SALESFORCE_USERNAME}" --filelog 0 -n
sandbox:
'Import seed data':
description: Import seed data into your Sandbox
run: |
echo y | sf plugins install sfdmu
sf sfdmu run -p config/data -s csvfile -u "${SALESFORCE_USERNAME}" --filelog 0 -n

Did this answer your question?