Limiting artifacts to be built

Artifacts to be built can be limited by various mechanisms. This section deals with various techniques to limit artifacts being built

Limiting artifacts by domain

Artifacts to be built can be restricted by domain during a build process in sfp by utilizing specific configurations. Consider the release config example provided in

# release-config for sales
releaseName: sales
pool: sales-pool
excludeAllPackageDependencies: true 
  - sales-ui
  - sales-channels
  skipIfAlreadyInstalled: true
  usePackageDiffDeploymentMode: true
  promotePackagesBeforeDeploymentToOrg: prod
      -  (AKG|GIK)-[0-9]{2,5}
    limit: 30

You can use the path to the config file to the build command to limit the artifacts being built as in the sample below

// Limit build by release config
sfp build -v devhub --branch=main --domain config/sales.yaml

Limiting artifacts by packages

Artifacts to be built can be limited only to certain packages. This could be very helpful, in case you want to build an artifact of only one package or a few while testing locally.

// Limit build by certain packages
sfp build -v devhub --branch=main -p sales-ui,sales-channels

Limiting artifacts by ignoring packages

Packages can be ignored from the build command by utilising an additional descriptor on the package in project manifest (sfdx-project.json)

In the above scenario, src-env-specific-pre will be ignored while build command is invoked

Last updated