I have a task that I want to re-use in multiple jobs, but I don't want to have to repeat the task configuration for every job. What's the best way for me to do that?
Example:
jobs:
- name: build
plan:
- get: git-branch
trigger: true
- task: get-build-tag # <---- duplicate of below
config: {} # truncated for brevity
- task: build-image
file: some-stuff-to-do-with-get-build-tag
- name: test
plan:
- get: git-branch
trigger: true
- task: get-build-tag # <---- duplicate of above
config: {} # truncated for brevity
- task: run-tests
file: also-to-do-with-get-build-tag
Note to those who have flagged this question as a duplicate: I was instructed by the Concourse team to post this question on here specifically about Concourse configuration. Should configuration ever change from YAML to something else, this post could still act as a reference despite having nothing to do with YAML.