Gated Pipeline Patterns
Gated pipelines provide control for administrators and release managers on when a given software release is deployed to a tightly protected environment (e.g. production).
The execution of jobs that perform certain tasks (e.g. deployment) targeting the downstream environment beyond the " gate" step is done only upon either an approval coming from an external Change Control system or an explicit manual trigger of such step.
1) - A Simple Gated Pipeline
By default, all Jobs only run when manually triggered. That means a user has to run
fly trigger-job or click the plus button in the web interface for a job to run. A job
only runs automatically if one of its resources has the trigger: true parameter set.
Therefore, in order to create a gated job in a pipeline you simply need to create a job that can only be manually
triggered. That means not setting trigger: true for any of the jobs' get steps.
jobs:
- name: run-automatically
plan:
- get: my-repo
trigger: true # has trigger:true so automatically triggers
# can include more steps to run other things before hitting the gate
- name: the-gate # manually trigger this job
plan:
- get: my-repo
trigger: false # redundant but guarantees the job won't run automatically
passed:
- run-automatically
# runs immediately after the gate is triggered
- name: do-more-stuff-after-the-gate
plan:
- get: my-repo
passed:
- the-gate
trigger: true
# can include more steps to run other things
resources:
- name: my-repo
type: git
source:
uri: https://github.com/concourse/examples.git
2) - Gated Pipeline Fanning In and Out
You can also use a gate as way to fan-in from multiple jobs and/or fan-out to multiple jobs as well.
3) - A Gated Pipeline With Notifications
This pipeline shows you how you can send a notification, like an email, to notify someone that a new build of your application is ready to be shipped.


