Concourse Lab Creation
Testing Environment
Running Concourse
With Docker-Compose
This docker-compose file simplifies the installation to do some tests with concourse:
You can download the command line fly
for your OS from the web in 127.0.0.1:8080
With Kubernetes (Recommended)
You can easily deploy concourse in Kubernetes (in minikube for example) using the helm-chart: concourse-chart.
After generating the concourse env, you could generate a secret and give a access to the SA running in concourse web to access K8s secrets:
Create Pipeline
A pipeline is made of a list of Jobs which contains an ordered list of Steps.
Steps
Several different type of steps can be used:
the
set_pipeline
step configures a pipelinethe
load_var
step loads a value into a local varthe
in_parallel
step runs steps in parallelthe
do
step runs steps in sequencethe
across
step modifier runs a step multiple times; once for each combination of variable valuesthe
try
step attempts to run a step and succeeds even if the step fails
Each step in a job plan runs in its own container. You can run anything you want inside the container (i.e. run my tests, run this bash script, build this image, etc.). So if you have a job with five steps Concourse will create five containers, one for each step.
Therefore, it's possible to indicate the type of container each step needs to be run in.
Simple Pipeline Example
Check 127.0.0.1:8080 to see the pipeline flow.
Bash script with output/input pipeline
It's possible to save the results of one task in a file and indicate that it's an output and then indicate the input of the next task as the output of the previous task. What concourse does is to mount the directory of the previous task in the new task where you can access the files created by the previous task.
Triggers
You don't need to trigger the jobs manually every-time you need to run them, you can also program them to be run every-time:
Some time passes: Time resource
On new commits to the main branch: Git resource
New PR's: Github-PR resource
Fetch or push the latest image of your app: Registry-image resource
Check a YAML pipeline example that triggers on new commits to master in https://concourse-ci.org/tutorial-resources.html
Last updated