Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Environment Variables

Matthias Rolke edited this page Jul 18, 2017 · 2 revisions

1) In a simple scenario you can inject the credentials for a default remote using the following environment variables

$ export [email protected]
$ export SFDC_PASSWORD=passwordWithSecurityToken
$ export SFDC_SERVER_URL=https://test.salesforce.com

listing your remotes then leads to

$ force-dev-tool remote -v
env (default): [email protected] passwordWithSecurityToken https://test.salesforce.com

That means you can either pass the remote name env to a test/deploy command or even leave it out as it is the default remote and therefore optional for most of the commands (e.g. Usage: force-dev-tool test [options] [<remote>]):

$ force-dev-tool test
$ force-dev-tool test env

2) In a more complex scenario, let's say you want to retrieve metadata from one sandbox and deploy it to another one, you could also inject multiple credentials using environment variables following the schema SFDC_XXX_USERNAME, SFDC_XXX_PASSWORD, SFDC_XXX_SERVER_URL:

$ export [email protected]
$ export SFDC_source_PASSWORD=passwordWithSecurityToken
$ export SFDC_source_SERVER_URL=https://test.salesforce.com
$ export [email protected]
$ export SFDC_target_PASSWORD=password2WithSecurityToken2
$ export SFDC_target_SERVER_URL=https://test.salesforce.com

listing your remote environments then leads to

$ force-dev-tool remote -v
source: [email protected] passwordWithSecurityToken https://test.salesforce.com
target: [email protected] password2WithSecurityToken2 https://test.salesforce.com

retrieving from source and deploying to target

$ force-dev-tool retrieve source
$ force-dev-tool deploy target
Clone this wiki locally