A pipeline is the result of configuring Jobs and Resources together. When you configure a pipeline, it takes on a life of its own, to continuously detect resource versions and automatically queue new builds for jobs as they have new available inputs.
Pipelines are configured via fly set-pipeline or the set_pipeline step.
By default, newly configured pipelines are only visible to the pipeline's team. To make a pipeline viewable by other teams and unauthenticated users, run:
$ fly -t example expose-pipeline --pipeline my-pipeline
1 Basic
Command:
fly -t tutorial set-pipeline -c pipeline.yml -p hello-world
-p: give a name to the pipeline.
pipeline.yml:
jobs:
- name: job-hello-world
public: true
plan:
- task: hello-world
config:
platform: linux
image_resource:
type: docker-image
source: {repository: busybox}
run:
path: echo
args: [hello world]
Result from the command:
pipeline created!
you can view your pipeline here: http://127.0.0.1:8080/teams/main/pipelines/hello-world
the pipeline is currently paused. to unpause, either:
- run the unpause-pipeline command
- click play next to the pipeline in the web ui
Reference: https://concoursetutorial.com/basics/basic-pipeline/
2 Pipeline Resources
Define the resource in the pipeline YMAL file.
resources:
- name: resource-tutorial
type: git
source:
uri: https://github.com/starkandwayne/concourse-tutorial.git
branch: develop
Use the resource in a pipeline.
jobs:
- name: job-hello-world
public: true
plan:
- get: resource-tutorial
- task: hello-world
file: resource-tutorial/tutorials/basic/task-hello-world/task_hello_world.yml
Note:
hello-world can access anything from resource-tutorial (this tutorial's git repository) under the resource-tutorial/ path
To run it.
cd ../pipeline-resources
fly -t tutorial sp -c pipeline.yml -p hello-world
fly -t tutorial up -p hello-world
Reference: https://concoursetutorial.com/basics/pipeline-resources/
jobs:
- name: job-pass-files
public: true
plan:
- get: resource-tutorial
- task: create-some-files
config:
...
inputs:
- name: resource-tutorial
outputs:
- name: some-files
run:
path: resource-tutorial/tutorials/basic/task-outputs-to-inputs/create_some_files.sh
- task: show-some-files
config:
...
inputs:
- name: resource-tutorial
- name: some-files
run:
path: resource-tutorial/tutorials/basic/task-outputs-to-inputs/show_files.sh
Reference:
https://concoursetutorial.com/basics/task-outputs-to-inputs/