Controlling Aspects of Installation
Skip artifacts if they are already installed
// Command to deploy set of artifacts to devhub
sfp install -u devhub --artifactdir artifacts --<a data-footnote-ref href="#user-content-fn-1">skipifalreadyinstalled</a> By using the skipifalreadyinstalled option with the deploy command, you can prevent the reinstallation of an artifact that is already present in the target organization.
Install artifacts to an org baselined on an another org
// Command to deploy with baseline
sfp install -u qa \
--artifactdir artifacts \
--skipifalreadyinstalled --<a data-footnote-ref href="#user-content-fn-2">baselineorg</a> devhub
The --baselineorg parameter allows you to specify the alias or username of an org against which to check whether the incoming package versions have already been installed and form a deployment plan.This overrides the default behaviour which is to compare against the deployment target org. This is an optional feature which allows to ensure each org's are updated with the same installation across every org's in the path to production.
Install without committing the change
sfp install -u qa --artifactdir artifacts \
--check-only --artifacts core-crm--check-only turns the installation into a Salesforce validate-only deployment. The metadata is checked for deployability against the target org and any tests that the installation would run are executed, but nothing is committed to the org.
The flag applies to the packages named by --artifacts, and sfp rejects the command when that flag is absent — there is no way to run a whole artifact directory as check-only. Names may carry a version (core-crm:1.2.3); sfp matches on the name.
Because a validate-only deployment is a metadata deployment, this applies to source packages. Installing an unlocked package version is not a metadata deployment and is unaffected.
Choose which tests run
Installation skips tests by default. --runtests turns them on, and --use-relevant-tests narrows what runs:
sfp install -u qa --artifactdir artifacts --runtests --use-relevant-tests--use-relevant-tests asks Salesforce for RunRelevantTests on source packages, so only the tests covering the deployed components run rather than the full local suite.