Reviewing Common CI/CD Patterns

Discuss various CI/CD patterns.

As with any engineering discipline, we can generally find patterns that help implement a specific strategy or outcome. This is also true when we’re dealing with CI/CD pipelines. Branching strategies for our repository can be loosely or tightly coupled to the pattern we decide to go with but are not in themselves CI/CD patterns.

As we’re using Git as our source control management system, the notion is that we’ll generally be developing in a branch, pushing those changes remotely, and, ultimately, creating a pull request to merge our code into a branch suitable for building a deployable artifact.

However, there are some patterns that, when automated, will give us an advantage, especially if multiple environments or artifacts are used.

Environment-based

Using an environment-based approach to software deployment is typical of most development life cycles. Two patterns are commonly leveraged to facilitate multi-environment deployments:

  1. The first is to have all environments captured in one pipeline, which controls whether each environment can be either rolled forward or rolled back.

  2. The second is to have one pipeline that can be executed for any environment.

As an example, we might wish to have a standardized pipeline set up for any environment to ensure every deployment is consistent.

The following illustration shows a singular pipeline for any environment approach:

Get hands-on with 1400+ tech skills courses.