This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
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 SFDC_USERNAME=jdoe@universal-containers.com.mydev
$ 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): jdoe@universal-containers.com.mydev 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 SFDC_source_USERNAME=jdoe@universal-containers.com.mydev
$ export SFDC_source_PASSWORD=passwordWithSecurityToken
$ export SFDC_source_SERVER_URL=https://test.salesforce.com
$ export SFDC_target_USERNAME=jdoe@universal-containers.com.qa
$ 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: jdoe@universal-containers.com.mydev passwordWithSecurityToken https://test.salesforce.com
target: jdoe@universal-containers.com.qa password2WithSecurityToken2 https://test.salesforce.com
retrieving from source and deploying to target
$ force-dev-tool retrieve source
$ force-dev-tool deploy target