This guide explains how to perform “blue-green” deployments using XL Release and XL Deploy. Blue-green deployment is a pattern in which identical production environments known as Blue and Green are maintained, one of which is live at all times. Applications or features are deployed to and tested on the non-live environment (Green) before user traffic is diverted to it.

After users are using the new features in the Green environment, the Blue environment can be updated with more changes. If it is necessary to roll back the release in the Green environment, you can simply route user traffic back to the Blue environment.

In XL Release, you can implement a blue-green deployment by:

  1. Selecting the environment in a User Input task
  2. Using a precondition to determine which release tasks to execute

Step 1 Add preconditions to tasks

Preconditions allow you to specify which tasks are performed during a release.

This is a an example of a User Input task (highlighted) that allows you to choose the Blue or Green environment. The selected environment is stored in a release variable that is then used in preconditions on the subsequent Blue and Green Sequential Blocks. The precondition determines whether XL Release executes the Blue or Green block. It will skip the block for the environment that was not chosen.

Sample blue-green release

Step 2 Create and execute the release

When you create a release, leave the release variable for the environment choice empty. This allows it to be specified when the release reaches the User Input task.

Sample blue-green release

When the release reaches the task, you enter the environment to use:

Sample blue-green release

The selected Sequential Block is executed, and the other block is skipped:

Sample blue-green release

Tip: XL Release also supports global variables that you could use to indicate whether the current live environment is Blue or Green across all of your releases.