This is a Heroku Buildpack to install the Salesforce CLI.
Both the sfdx
and sf
executables are installed. See Salesforce CLI Unification for differences between them.
heroku buildpacks:set https://github.com/douglascayers/heroku-salesforce-cli-buildpack#latest -a my-app
For stability reasons, you may want to lock dependencies - including buildpacks - to a specific version.
First, find the version you want from
the list of buildpack versions.
Then, specify that version with buildpacks:set
by appending the version tag to the url:
heroku buildpacks:set https://github.com/douglascayers/heroku-salesforce-cli-buildpack#v1 -a my-app
The buildpack automatically exports the cli binary onto the $PATH
for easy use in subsequent buildpacks.
By default, the buildpack will install the latest Salesforce CLI version from the stable channel.
The buildpack automatically infers the operating system and machine architecture of the Heroku dyno to know which binary to install. However, you may set the following configuration variables to use specific values.
Variable | Sample Value | Default | Description |
---|---|---|---|
SALESFORCE_CLI_VERSION | v7.152.0 | latest | Which version to download. |
SALESFORCE_CLI_OS | linux, macos | (inferred) | Which operating system you're installing on. |
SALESFORCE_CLI_ARCH | x64, arm64 | (inferred) | Which CPU architecture you're installing on. |
Salesforce recommends that you always use the latest version or release candidate of Salesforce CLI. However, you can set SALESFORCE_CLI_VERSION
if you need to pin your app to a specific version.
-----> Salesforce app detected
-----> Creating runtime environment
SALESFORCE_CLI_VERSION=7.152.0
SALESFORCE_CLI_OS=darwin
SALESFORCE_CLI_ARCH=x64
-----> Downloading Salesforce CLI
https://developer.salesforce.com/media/salesforce-cli/sfdx/versions/7.152.0/3054818/sfdx-v7.152.0-3054818-darwin-x64.tar.gz
-----> Installing Salesforce CLI
sfdx-cli/7.151.1 darwin-x64 node-v16.15.0
@salesforce/cli/1.28.0 darwin-x64 node-v16.15.0
-----> Successfully installed Salesforce CLI
- Install shell-format Visual Studio Code extension
- Add the following to your
settings.json
"shellformat.flag": "-i 2 -ci -bn -sr", "shellformat.effectLanguages": [ "shellscript", "dockerfile", "dotenv", "hosts", "ignore", "gitignore", "properties", ]