Most of our pipelines follow the following pattern for triggering jobs. This should be used unless there’s a good reason not to.
Pipelines start with an
init job that bumps a
resource. This resource is then used to trigger everything else througout the
pipeline. This ensures that all of a pipeline runs, even if some of the
jobs/tasks are a no-op. It also means there is a consistent way to initiate a
pipeline run (where they are triggered manually).
Tasks should be given names that are verbs. Inputs and outputs should be given names that are nouns. Inputs and outputs should not be given names that are the same as a task name.
For example a task that takes a terraform state file and extracts the outputs
should be named as follows:
- task: extract-terraform-outputs
- name: paas-cf
- name: foo-tfstate
- name: terraform-outputs
Ordering of sections
Task config section should be ordered as follows:
This makes it easier to follow the flow of a task and see what it operates on.