2.9 KiB
2.9 KiB
Concourse Note
On 2025-10-07, I wanted to modify CI to build a new docker image in CI out of lana-bank.
I teamed up with Justin who gave me a nice overview of what's happening in lana-bank's concourse CI. Was good both for learning about concourse and lana-bank's specifics.
There's a lot to unpack, so I'm writing some notes before all the knowledge flies away:
-
Hierarchy
- Pipelines (such as
lana-bank) contain...- Groups (such as
lana-bankandnix-cache) are dumb namespaces to group...- Jobs (the colored boxes in the UI, which get run)
- Groups (such as
- Pipelines (such as
-
Each job gets defined through one single YAML file. This YAML file gets generated dynamically from the scripts under
cinamedrepipe. Thisrepipescripts useytt, a templating tool.repipe:- Composes the final job output
- Applies it to the pipeline to define what runs on concourse
- Note: you can actually "test in production" by running the
repipescript while your localflyCLI is pointing to our concourse production instance. It will modify the actual production job definition there.
-
Jobs use resources, which are external states
-
State can either be an input (
get) or an output (put).gets just get fetched,puts get mutated.- Resources have a
type, which specifies what it really means togetorputthem. There are many includedtypes in concourse, but you can also build your own custom ones if needed.
- Resources have a
-
Some stuff on
ytt- The special characters to reference values are
#@. - You can create a file to drop values to keep it all tidy and then reference it in the target file (we set values in
values.yml, then reference them inpipeline.yml) yttnot only provides simple values templating but also more sophisticated python function passing.
- The special characters to reference values are
-
On resources in a job:
- On
getresources, specifyingtrigger: truedefines that any updates to that resources should trigger a job run. - Also on
getresources, specifyingpassedwhile pointing to other jobs will signal that a certain resource should only be fetched if a certain job has built successfully. This chains jobs and prevents running downstream if upstream is failing. - Even if you define resources in
getandputin a job, you still need to define them againinputsandoutputswithin thetaskentry so they are available (technically mounted). - This is because the
get,taskandputparts are all runnable steps. Callinggetruns it, but doesn't make the state available totaskby default. That's why you needinputs.
- On
-
On secrets
- Many of the values that we interpolate with
yttare actually references to our HashicorpVault. They can be spotted because they use double parantheses(( some_secret )). This get replaced at runtime in concourse. It's fine to hardcode stuff invalues.ymlin the repo, but secrets must go into theVault.
- Many of the values that we interpolate with