I have been looking to automate the process of creating a scratch org, pushing source (metadata), assigning the permission sets, resetting the password, open the org and much more.

After doing some R&D I stumbled upon sfdx plugins I've looked at quite a few examples ranging from retrieving data to authenticating an org. I haven't found an example of pushing/pulling the source (metadata). I also looked into the Salesforce Core library but no luck there.

Can you not push/pull the source from sfdx plugins?

Note: This is not for test automation, it is for developers in the team. We want to be able to just run one command with a few flags that will do the job for us.

Any help is appreciated!

  • Pushing and pulling source are core SFDX commands. Are you saying that you want to build an SFDX plugin that invokes those core commands? – David Reed Dec 13 '19 at 14:53
  • @DavidReed yes, just by calling the plugin I want those commands to run. – d_k Dec 16 '19 at 6:24

Disclaimer: I am part of the team building this free and open-source product.

Orchestrating scratch org builds, specifically including creation, pushing source, setting passwords, assigning permission sets (via sfdx invocation), and opening the org is the raison d'etre of CumulusCI, Salesforce.org's build toolchain.

CumulusCI is configured via a YAML file that defines flows, sequences of tasks that build a specific kind of org (you can have more than one - e.g., an org for a developer will look different from a beta testing org). Tasks can invoke underlying SFDX functionality, including that provided by plugins and core commands, and run operations from CumulusCI's library of actions written in Python.

An org is built with a single command, such as cci flow run dev_org (which would create a development scratch org, set its password, and run the automation to configure that type of org). CumulusCI works interactively and in headless CI builds. There's a (very) comprehensive example of its capabilities in the automation that builds the Nonprofit Success Pack.

  • thanks for your answer although I'm not looking to setup CCI I just want to achieve this using sfdx plugins. – d_k Dec 16 '19 at 6:22
  • Clarification in response to a proposed edit: CumulusCI is a free and open source (BSD-licensed) product that accepts contributions from the community. I am not intending to take a position on whether or not SFDX itself is open source. – David Reed Apr 20 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.