devops promotion complete

Deploy undeployed work items to a pipeline stage org.

Description for devops promotion complete 

Deploys work items that were merged into the pipeline branch outside of DevOps Center (externally merged) into the target stage org and updates DevOps Center records. Equivalent to the “Complete Promotion” action in the DevOps Center UI when a stage is out of sync.

If no undeployed work items are found for the stage, the command exits successfully with no action taken.

Flags 

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑deploy‑all‑aType: Boolean

Deploy all metadata in the branch to the stage’s org.

If you don’t specify this flag, only changes in the stage’s branch are deployed.
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑target‑stage‑id‑tType: Value
Required

ID of the out-of-sync pipeline stage to deploy to.
‑‑test‑level‑lType: Value
Valid Values: NoTestRun, RunSpecifiedTests, RunLocalTests, RunAllTestsInOrg

Deployment Apex testing level.

Valid values are:

  • NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
  • RunSpecifiedTests — Runs only the tests that you specify with the –tests flag. Code coverage requirements differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage.
  • RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers.
  • RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.


If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see the section “Running Tests in a Deployment” in the “Metadata API Developer Guide”. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
‑‑testsN/AType: Value

Apex tests to run when –test-level is RunSpecifiedTests.

Separate multiple test names with commas. Enclose the entire flag value in double quotes if a test name contains spaces.
‑‑work‑item‑id‑iType: Value

ID of a specific work item to deploy. Omit to deploy all undeployed work items for the stage. Use this for the first stage of a pipeline where no source stage exists.

Examples for devops promotion complete 

Complete a promotion for an out-of-sync pipeline stage.

1sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001

Complete a promotion for a specific work item (e.g. first stage of a pipeline).

1sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001 --work-item-id 1fk000000000001

Complete a promotion with full deploy and a specific test level.

1sf devops promotion complete --target-org my-devops-org --target-stage-id 1QV000000000001 --deploy-all --test-level RunLocalTests