Multi-environment promotion with conditions

Promote product apps between multiple environments with promotion conditions

Now that we have reviewed multi-environment promotion in Multi-environment sequential promotion, let’s configure policies to manage promotion conditions, ensuring that each environment’s specific requirements are met before changes are promoted.

What are Promotion Policies?

Promotion Policies define the criteria for promoting changes through each environment. They govern promotion behavior through include automated tests, scans, quality checks, approvals, notifications, and more.
You can define promotion criteria through Promotion Workflows, modeled on Argo Workflows.

  • Create Promotion Workflows in Codefresh by selecting Promotion Workflows from the sidebar.
Assigning Policy settings

Promotion Policies support three optional settings:

  • Pre-Action Workflow: The workflow to run before the Promotion Action.
  • Promotion Action: The action that promotes the changes, which defaults to Commit if not set.
  • Post-Action Workflow: The workflow to run after the Promotion Action.

We’ll define the policy settings for the three-env-promotion Promotion Flow to manage promotion behavior for the qa and production target environments.

Assigning settings is as simple as clicking the respective controls and selecting the workflows/action from the list.

Policy settings for target environments

Policy settings for target environments

For both qa and production, we’ll select the same workflows and the same promotion action.

Target environments with policy settings

Target environments with policy settings

Here’s the YAML view of the promotion flow with the workflows and promotion actions.

YAML view of policy settings

YAML view of policy settings
Triggering policy-driven Promotion Flow

We’ll save the changes to the three-env-promotion flow, trigger it, and monitor the release view.

In contrast to the previous release, the current release view shows the qa and production environments with the Pre- and Post-Action Workflows defined for each environment.

Release view for policy-driven Promotion Flow

Release view for policy-driven Promotion Flow

Promotion tutorials