Orchestrate your builds and deployment with minimal code/config
sfpowerscripts:orchestrator is a group of commands (or topic in the CLI parlance) that enables one to work with multiple packages in a mono-repo through the development lifecycle or stages. The current version of the orchestrator features these commands
- 1.prepare (sfdx sfpowerscripts:orchestrator:prepare): Prepare command helps you to build a pool of prebuilt scratch orgs which include managed packages as well as packages in your repository. This process allows you to considerably cut down time in re-creating a scratch org during a pull request validation process when a scratch org is used as Just-in-time CI environment. In simple terms, it reduces time taken in building a scratch org to validate your changes in an incoming pull request. This command also have an option to pull artifacts from your artifact repository, so that say you can prebuild your validation orgs, say from validated set of packages.
- 2.validate (sfdx sfpowerscripts:orchestrator:validate): This command goes in pair with the prepare command. It fetches a scratch org from the pool already created (by the prepare command) and deploys/unit tests the changed packages. Different validation mode options exist depending on your requirements for individual, fast feedback, thorough, and leveraging release configuration files.
- 3.build (sfdx sfpowerscripts:orchestrator:build/quickbuild) : This command builds all the packages in parallel wherever possible by understanding your manifest and dependency tree. Goodbye to the sequential builds, where you fail in the n-1th package and have to wait for the next hour. This command brings massive savings to your build (package creation) time. Also use the quickbuild variant, which builds unlocked package without dependency check in intermittent stages for faster feedback.
- 4.deploy (sfdx sfpowerscripts:orchestrator:deploy): So you have built all the packages, now this command takes care of deploying it, by reading the order of installation as you have specified in your sfdx-project.json. Installs it one by one, deciding to trigger tests etc. and provide you with the logs if anything fails
- 6.release (sfdx sfpowerscripts:orchestrator:release) : Release commands orchestrate fetching of artifacts from an artifact repository, deploying to an environment including any external dependencies and generating changelog all driven by a release definition file.
Orchestrator utilizes additional properties mentioned along with each package in your sfdx-project.json which can be used to control what the orchestrator should work with each package.
Sometimes, due to certain platform errors, some metadata components need to be ignored during quickbuild or validate or any other stages. sfpowerscripts offer you an easy mechanism, which allows to switch .forceignore files depending on the stage.
Add this entry to your sfdx-project.json and as in the example below, mention the path to different files that need to be used for different stages
ignoreOnStagedescriptor to mark which packages should be skipped by the lifecycle commands.