Skip to main content
In the previous lesson, we enabled a new Auto DevOps deployment strategy, pushed changes to a feature branch, and reviewed the Merge Request (including security and performance reports). Now we’ll merge into main and watch Auto DevOps deploy to production using an incremental canary strategy.

1. Merge into main and Trigger Production Pipeline

Once the Merge Request is accepted, GitLab triggers a new pipeline on the protected main branch. This pipeline adds deployment stages on top of the build, test, DAST and performance jobs.
The image shows a GitLab pipeline interface for a project named "testing autodevops canary release," displaying various stages like build, test, review, dast, and performance, all marked as passed.
The image shows a GitLab pipeline interface with stages for deployment, including dast, staging, production rollout, performance, and cleanup. The pipeline is currently running a merge from a feature branch into the main branch.
The full sequence is:
  1. build
  2. test
  3. review (DAST)
  4. staging
  5. production rollout (10%, 25%, 50%, 100%)
  6. performance
  7. cleanup

Cancelling Unneeded Jobs

If you need to skip rerunning certain tests, you can:
  • Manually cancel jobs in the GitLab UI
  • Disable specific jobs via Settings > CI/CD
For this walkthrough, we’ll focus on the staging and manual production rollout stages.

2. Staging Deployment

After build, test, and DAST succeed, the staging job deploys to the staging namespace and then waits for the production approval.
You can also verify the deployment under Operations > Environments:
The image shows a GitLab interface displaying the "Environments" section with active environments like "production," "review/feature/adsa," and "staging." It highlights a successful deployment in the "staging" environment with options to open the live environment.
Opening the live URL confirms the staging app UI:
The image shows a stylized representation of the solar system with planets orbiting the sun, accompanied by a user interface for searching planets.
By default, Auto DevOps deploys to staging before production. To skip staging and deploy directly to production, set the CI/CD variable:

3. Manual Production Deployment

Production is a protected environment requiring manual approval. Before rolling out, inspect current production workloads:
Navigate to Operations > Environments > production and click Approve on the pending rollout:
The image shows a GitLab interface with a pop-up window for approving or rejecting a deployment. It includes details about the environment, deployment tier, and manual job, with options to add comments and approve or reject the deployment.
Once approved, click Run job on the next percentage rollout:
The image shows a GitLab interface for a job that requires manual action to start a deployment to production. It includes options to input CI/CD variables and a "Run job" button.

4. Canary Rollouts

Use incremental percentages to minimize risk. Below is a summary of each stage:

4.1 10% Canary

The job log runs:
Verify both primary and canary pods:
Check the canary Ingress weight:
Run load tests to confirm ~10% traffic hits the canary pods:

4.2 50% Midway

Approve and Run job for 50% rollout. After success, the weight updates:
Validate with a repeat of the traffic test:
The image shows a GitLab interface displaying a list of production deployments with their statuses, IDs, commit details, and actions. The sidebar includes options for managing code, deployments, and environments.

4.3 100% Full Release

Approve and Run job for 100% rollout to merge canary into the primary deployment and remove the canary service:
The image shows a GitLab pipeline interface for merging a branch into the main branch, displaying various stages like review, dast, staging, production, and performance, with progress indicators.
After completion, verify only the updated primary pods remain:
Cleanup runs automatically:

What You Learned

  • How Auto DevOps orchestrates staging and production deployments
  • Manual approval workflows for protected environments
  • Incremental canary rollouts (10%, 50%, 100%) with traffic validation
  • Automatic cleanup of canary resources

Watch Video