The runtime environment where the scripts defined in your hutte.yml
file are executed is based on Ubuntu. For detailed specifications, refer to the Heroku Stack Packages documentation and review the information for the heroku-22 version.
The following environment variables are available for use in your custom scripts:
Variable name | Description | Available in Scratch Org creation (push_script and setup_script) | Available in custom_script |
---|---|---|---|
SF_TARGET_DEV_HUB |
DevHub Username (alias) | ✓ | ✓ |
SF_TARGET_ORG |
Username (alias) of the connected Org | ✓ | ✓ |
HUTTE_GIT_SOURCE_BRANCH |
Feature branch name | ✓ | ✓ |
HUTTE_GIT_USER_NAME |
Git username | 𐄂 | ✓ |
HUTTE_GIT_USER_EMAIL |
Git email | 𐄂 | ✓ |
HUTTE_CUSTOM_SCRIPT_NAME |
Name of the executed custom script | 𐄂 | ✓ |
SF_TARGET_ORG_#{TARGET_ORG_NAME} , where TARGET_ORG_NAME is the target org name replacing special chars, using _ as separator and replacing - with _ . |
|||
Example: | |||
SF_TARGET_ORG_myorg1 |
Username (alias) of the target Orgs connected to the project. This allows for example running data deployments from a custom button. | 𐄂 | ✓ |
Here is a sample usage of the custom variable SALESFORCE_USERNAME
. This example is from a custom button that runs a data import using the popular SFDMU plugin:
custom_scripts:
scratch_org:
"Import Data":
description: "Import data using SFDMU"
run: |
echo y | sfdx plugins install sfdmu
sfdx plugins
sfdx sfdmu run -p data -s csvfile -u "${SALESFORCE_USERNAME}" --filelog 0 -n
Find more examples for custom scripts in Setting up your Hutte.yml.