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 usedev
,qa
, andprod
. -
Application in each environment
Each environment must have an application for the product, such asdemo-trioapp-dev
,demo-trioapp-qa
, anddemo-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.
- In the Codefresh UI, on the toolbar, click the Settings icon.
- From the sidebar select Promotion Flows, and then click Add Promotion Flow.
- 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
.
- Name: The name for the flow. For this quick start, we’ll use
- Click > to close the panel.
- Select the Trigger Environment as the starting point for the promotion. For the quick start, select
dev
.
- Select the target environments in the promotion sequence to which to promote changes:
qa
andprod
.- Mouse over the right of the
dev
environment node and click . - From the list, select the first target environment in the flow,
qa
for this quick start. - Repeat the action on the
qa
environment node to add the next target environment. For the quick start, we’ll addprod
as the final target environment in the flow.
- Mouse over the right of the
- 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.
- To add the new flow to the Promotion Flows list, click Save.
- 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.
- From the list of Promotion Flows, select
multi-env-sequential-promotion
and then click Trigger to initiate the promotion.
- Select the product to promote. For this quick start, select
demo-trioapp
, and continue by clicking Next.
- Select the application with the changes to promote. In our case, the application
demo-trioapp-dev
is automatically selected. - To initiate the promotion, click Trigger.
- 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
, andprod
as per themulti-env-sequential-promotion
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.
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.