Install, authenticate with, and utilize the Salesforce sfdx CLI on CircleCI with ease.
Read the full automated documentation live on the Orb Registry:
Base64 encode your private key
Navigate to the directory containing the self signed certificate files you created earlier and enter the following command: base64 server.key
. Once you have the base64 encoded value, copy it for the next step.
Add environment variables
https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project
SFDX_JWT_KEY
This value must contain the base64 encoded value of the private server.key file.SFDX_CONSUMER_KEY
The consumer key of the connected app for salesforce
version: 2.1
orbs:
sfdx: circleci/[email protected]
jobs:
install_authenticate:
executor: sfdx/default
steps:
- checkout
- sfdx/install
- sfdx/auth:
defaultusername: [email protected]
- run:
name: Run your SFDX commands here
command: |
echo "You now have access to the sfdx cli and may execute commands against it. https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm"
sfdx force:auth:list
workflows:
basic-test:
jobs:
- install_authenticate
Read our announcement post here: