Black Friday race Join
Software development

CI/CD pipeline template

Seven stages from commit to monitor, with durations, a table of five quality gates and the rules of staging and production. The example is an online shop’s pipeline.

The CI/CD pipeline template

What is a CI/CD pipeline?

A CI/CD pipeline is the fixed series of automatic steps that every code change goes through between a developer’s push and the users. Continuous integration (CI) builds and checks each change. Continuous delivery (CD) carries a change that passed to staging and then to production.

This template draws a pipeline as seven stages in a row: Commit, Build, Test, Scan, Staging, Production and Monitor. Under the stages it adds what most pipeline drawings leave out: the gates that stop the line and the rules of each environment. The example is the pipeline of an online shop.

The CI/CD pipeline template: seven stage columns from Commit to Monitor, a Quality gates table underneath and two Environments cards.
The whole board: stages on top, gates and environments below.

The four stages every pull request runs

A bracket over the first four columns reads “Runs on every pull request, about 16 min”. Each column has a name, the tool that runs it, how long it takes and three steps:

  • Commit, 1 min. Push to a branch, open a pull request, lint and format.
  • Build, 4 min. Install, with cache; compile and bundle; build image, tag SHA.
  • Test, 8 min. Unit tests, integration tests, coverage at least 80%.
  • Scan, 3 min. Dependency audit, secret scan, image scan.

The durations add up to the 16 minutes on the bracket. That sum is the time an author waits for an answer, and the slowest column, Test, is where to look first when the wait grows. A red bar under the columns says what a failure means: the pipeline stops, the pull request turns red and the author gets a message in #ci.

1 + 4 + 8 + 3 minutes: the wait for feedback on a pull request.

What a merge to main adds

The second bracket covers the last three columns: “Runs after a merge to main, about 21 min”. Staging takes 6 minutes to deploy the image, run migrations and run smoke and E2E tests. Production takes 15: it waits for a manual approval, sends a canary to 10% of traffic, then does the full rollout.

Monitor is marked “Always on” and holds three limits: error rate under 1%, p95 latency under 400 ms, and page on-call on alerts. A dashed arrow labeled “Roll back to the last good image” runs from Monitor back to Production, with the note “Alert fires”. That arrow is the difference between a pipeline that deploys and one that can also undo.

Deployment ends in monitoring, and an alert leads straight back to a rollback.

Write gates as numbers

The Quality gates table is the part to copy most carefully. It has three columns, Gate, Stage and “Stops the line when”, and five rows. None of the conditions is a matter of opinion:

  • Lint and types, at Commit: any error or warning.
  • Tests and coverage, at Test: a test fails or coverage drops under 80%.
  • Security scan, at Scan: a critical or high issue has a fix available.
  • Smoke and E2E, at Staging: sign-in, search or checkout fails.
  • Canary health, at Production: error rate 1% or more, or p95 over 400 ms, for 5 min.

A gate like “code quality is acceptable” starts an argument on every pull request. A gate with a threshold and a time window can be checked by a machine, which is the point of a pipeline.

Five gates, each tied to a stage and a measurable stop condition.

The two environments

Two cards on the right describe where the pipeline deploys. Staging lives at staging.shop.example. It deploys on every merge to main, holds a copy of production data with personal data masked, is open to anyone on the team for testing, and has its data reset every Sunday night.

Production is shop.example. It deploys after the release manager approves, canary first and then everyone. Rollback means redeploying the last good image. The last line is a team rule rather than a technical one: no deploys on Fridays after 15:00. Rules like that belong on the diagram, because they explain why a green pipeline sometimes waits.

Each environment lists who deploys to it, with what data and under which rules.

How to use the CI/CD pipeline template

  1. Open it as a new board and replace the tool name in each column with what your team runs.
  2. Time your own stages. Read the real durations from your last ten runs and correct the minutes, then the two bracket totals.
  3. Rewrite the three steps per column. Delete a column you do not have. If you deploy straight to production, drop Staging and move its smoke tests.
  4. Fill the gates table from your config. Every row should match a rule that actually fails a run today. Add a row for each gate you plan to introduce and mark it as planned.
  5. Correct the environment cards. Put in your URLs, your approver and your freeze rule.
The summary line states the whole policy in two sentences.

When this template fits, and nearby ones

Use it to document a pipeline for new joiners, to find the slow stage, or to agree on gates before you write the configuration. It shows one service’s path to production.

For the culture and metrics around the pipeline, the DevOps loop tracks deployment frequency and the other delivery metrics. For how branches reach main in the first place, see Gitflow branching. For a gradual launch behind a switch instead of a canary, use the feature flag rollout.

Questions about the CI/CD pipeline template

What is the difference between continuous delivery and continuous deployment?

With continuous delivery every change that passes is ready to release, but a person decides when. The example works this way: Production starts with a manual approval. With continuous deployment that approval is removed and every passing change goes live on its own.

How long should a CI pipeline take?

Short enough that authors wait for the result instead of switching tasks. The example gives a pull request an answer in about 16 minutes, 8 of them in tests. If yours takes much longer, split the test stage to run in parallel or cache the install step.

What is a canary release?

A release that first goes to a small share of users. In the example the canary takes 10% of traffic, and the Canary health gate stops the rollout if the error rate reaches 1% or p95 latency passes 400 ms for 5 minutes.

Is the CI/CD pipeline template free to use?

Yes. It has 114 elements and opens on the Free plan, which allows 150 elements on a board. The stages, the gates table and the environment cards can all be edited, and the board exports as PNG, SVG, PDF or JSON.