CI/CD Workflow

Facets provides various CI/CD strategies to streamline your deployment process. This document will guide you through configuring these strategies, enabling you to efficiently manage testing environments, automate promotions, and customize workflows to meet your project's needs.


Understanding Registration Types

The registration type is a fundamental decision that determines how artifacts route through your deployment pipeline. You select this when configuring CI/CD, and it cannot be changed without resetting the configuration.

ENVIRONMENT Registration

With ENVIRONMENT registration, artifacts route directly to physical Kubernetes clusters. Each artifact is assigned to a specific environment (dev cluster, staging cluster, production cluster) based on the routing rules you define.

Use ENVIRONMENT registration when:

  • You have dedicated clusters for each stage (dev, qa, staging, production)
  • You want artifacts to map directly to infrastructure
  • You deploy to Kubernetes environments

RELEASE_STREAM Registration

With RELEASE_STREAM registration, artifacts route to named channels (release streams) rather than physical environments. Release streams are logical promotion paths like "stable," "canary," or "beta" that decouple artifact routing from your infrastructure topology.

Use RELEASE_STREAM registration when:

  • You manage multiple release channels independently
  • You need flexible routing that isn't tied to specific clusters
  • You deploy the same artifact to multiple environments through different streams
🚧

Warning: Registration type cannot be changed after initial setup without resetting your CI/CD configuration, which deletes your default routing rule and promotion workflow.


Three CI/CD Strategies

All three strategies use the same underlying system: registration type, routing rules, and promotion workflows. The strategies represent different UI approaches to configuring this system.

Branch Per Environment

This approach creates direct mappings between Git branches and specific testing environments. You specify branch conditions, select the target environment, and repeat for all required environments. This method provides isolated changes in designated branches and environments, reducing the risk of conflicts.

Behind the scenes: This creates ENVIRONMENT registration with multiple routing criteria. Each branch-to-environment mapping becomes a criterion with priority-based evaluation.

Single Branch Promotion

With this strategy, a single Git branch feeds into an initial environment, then artifacts progress through a defined promotion workflow. You establish the branch condition, designate the starting environment, then arrange remaining environments in hierarchical order using drag-and-drop functionality.

Behind the scenes: This creates ENVIRONMENT registration with a single routing criterion and a multi-stage promotion workflow. The workflow defines the sequence through which artifacts progress.

Custom Configuration

This approach provides full access to the routing and promotion system. You can:

  • Choose between ENVIRONMENT or RELEASE_STREAM registration
  • Map specific Git branches to different environments/streams using custom routing criteria
  • Create promotion hierarchies across multiple stages
  • Define multiple routing rules with advanced branch pattern matching
  • Customize workflows for flexible deployment patterns

Behind the scenes: This is the full configuration interface that exposes all routing rule and promotion workflow capabilities.


How to Configure the CI/CD workflow in Facets?

  1. Open the Projects tab and select the required project.
  2. Go to the Project Settings tab and select CI/CD. Here, you will be able to define the CI/CD Flow.
  3. Facets provides three CI/CD strategies:
    1. Branch Per Environment
    2. Single Branch Promotion
    3. Advanced

Branch Per Environment

This approach allows you to map each Git branch to its respective testing environment for streamlined testing.

  1. Choose the condition from the dropdown and specify the value it must match.
  2. Select the environment to which you want to attach artifacts.
  3. Repeat the above steps for all the required environments in the project.
  4. Click Save Changes.

Single Branch Promotion

This approach allows you to map a Git branch to an environment. You will then set the promotion workflow and promote changes to other environments.

  1. Choose the condition from the dropdown and specify the value it must match.
  2. Select the environment to which you want to attach artifacts. The selected environment becomes the first environment in the flow.
  3. Under the Set Promotion Workflow section, all the environments will be listed. Drag and rearrange them in the required order to create the promotion hierarchy.
  4. Click Save Changes.

Advanced

This combines Branch per Environment and Single Branch Promotion. It enables you to customize Git rules for mapping branches to specific environments and create flexible promotion workflows.

  1. Select the Registration type.
    1. Choose between an Environment or a Release Stream. This determines whether you will use environments or release streams to create the workflow.
  2. Decide if you want to map any Git branch to the environment/release stream.
    1. If yes, map the Git branch to the environment/release stream.
    2. Choose the condition from the dropdown and specify the value it must match.
    3. Then, select the environment/release stream to which you want to attach artifacts.
    4. Click Add to add a new column for a different environment/release stream.
  3. Decide if you want to promote artifacts from one environment/release stream to another.
    1. If yes, under Environments/Release Streams Hierarchy, select the first environment/release stream.
    2. Drag and rearrange the environments/release streams in the required order to create the promotion hierarchy.
  4. Click Save Changes.

You have successfully created a Streamlined CI/CD Flow in Facets.

FAQ

1. Do I need to make any changes to my CI pipeline if I change the branch or environment/release stream?

Yes, if you change the branch or the associated environment/release stream, you will need to update the command in your CI pipeline setup to reflect these changes. This ensures the images are registered in the correct environment or release stream.

2. How does the "Branch Per Environment" strategy improve deployment workflows in a multi-environment setup?

The "Branch Per Environment" strategy improves deployment workflows by isolating changes in designated branches and environments, reducing the risk of conflicts and ensuring stable, environment-specific testing and deployment.