Quick start: Multi-environment sequential promotion

Promote product apps between multiple environments sequentially

Drag-and-drop promotion, covered in the previous quick start, is ideal for on-demand promotions to a single environment. In contrast, sequential promotion flows offer a structured approach to managing changes across multiple environments, minimizing deployment risks.

This quick start demonstrates creating a promotion flow with three environments (dev, qa, prod), triggering the flow, and monitoring its progress in the Releases view.

Before you begin

For this quick start, ensure that you have:

  • Three environments
    For multi-environment promotions, you need at least three environments. Here we use dev, qa, and prod.

  • Application in each environment
    Each environment must have an application for the product, such as demo-trioapp-dev, demo-trioapp-qa, and demo-trioapp-prod.

  • Consistent repo structure for applications
    The structure of the repos with the resources must be consistent across all the three applications.

Create Promotion Flow for multi-environment promotions

Codefresh simplifies creating multi-environment promotion sequences through Promotion Flows.
You can use the Flow Builder in either Chart or YAML modes depending on your preference to create a Promotion Flow.

NOTE
You need to be an account administrator to create Promotion Flows.

  1. In the Codefresh UI, on the toolbar, click the Settings icon.
  2. From the sidebar select Promotion Flows, and then click Add Promotion Flow.
  3. Enter the settings for the Promotion Flow:
    • Name: The name for the flow. For this quick start, we’ll use multi-env-sequential-promotion.
    • Description: (Optional) More information about the purpose of the Promotion Flow.
    • Flow Timeout: The maximum duration allowed for the Promotion Flow to complete execution after being triggered, before it is automatically terminated. If not specified, the default timeout is 1 day (24 hours). For this quick start, we’ll set it to 5 minutes.
    • Version: (Optional) The version of the Promotion Flow. This is manually defined and manually updated, and is useful to indicate changes in the same flow. For the quick start, we’ll set it to 1.0.

Promotions quick start: Define Promotion Flow settings

Promotions quick start: Define Promotion Flow settings
  1. Click > to close the panel.
  2. Select the Trigger Environment as the starting point for the promotion. For the quick start, select dev.

Promotions quick start: Select Trigger Environment

Promotions quick start: Select Trigger Environment
  1. Select the target environments in the promotion sequence to which to promote changes: qa and prod.
    1. Mouse over the right of the dev environment node and click .
    2. From the list, select the first target environment in the flow, qa for this quick start.
    3. Repeat the action on the qa environment node to add the next target environment. For the quick start, we’ll add prod as the final target environment in the flow.

Promotions quick start: Add target environment

Promotions quick start: Add target environment

Promotions quick start: Promotion Flow with required environments

Promotions quick start: Promotion Flow with required environments
  1. Click Save Promotion Flow on the top-right.
    The Name and Description are populated from the Settings. The flow’s YAML version on the right lists the environment sequence.

Promotions quick start: Save Promotion Flow

Promotions quick start: Save Promotion Flow
  1. To add the new flow to the Promotion Flows list, click Save.

Promotions quick start: Promotion Flow list with new flow

Promotions quick start: Promotion Flow page with new flow
  1. Continue with Trigger Promotion Flow.

Trigger Promotion Flow

Manually trigger the Promotion Flow to promote changes from the Trigger Environment to the defined target environments.

  1. From the list of Promotion Flows, select multi-env-sequential-promotion and then click Trigger to initiate the promotion.

Promotions quick start: Trigger selected Promotion Flow

Promotions quick start: Trigger selected Promotion Flow
  1. Select the product to promote. For this quick start, select demo-trioapp, and continue by clicking Next.

Promotions quick start: Select product to promote

Promotions quick start: Select product to promote
  1. Select the application with the changes to promote. In our case, the application demo-trioapp-dev is automatically selected.
  2. To initiate the promotion, click Trigger.
  3. Continue with View and monitor product release.

View and monitor product release

On triggering the flow, the promotion mechanism automatically creates a new release for the product (demo-trioapp), and orchestrates the changes sequentially through the environments defined in the Promotion Flow.

  • Click View Release Details to go to the release view and monitor the sequential progression of changes through dev, qa, and prod as per the multi-env-sequential-promotion Promotion Flow.

Promotions quick start: Release view for triggered Promotion Flow

Promotions quick start: Release view for triggered Promotion Flow
Release record in releases list

In the Releases page, the Promotion Flow column displays the name of the flow (multi-env-sequential-promotion for example) for traceability. For drag-and-drop promotions in contrast, this column displays Manual.

Promotions quick start: Release list with release record for triggered Promotion Flow

Promotions quick start: Release list with release record for triggered Promotion Flow

What’s next

To further enhance your promotion flow, the next quick start will guide you through adding gates to each environment for conditional promotions, allowing you to introduce more control and flexibility in your promotion processes.

Quick start: Multi-environment promotion with gates