Overriding/default ((vars)) #5446
-
To save time, only really the ((vars)) matter in the below example, specifically the ((template_branch)), but I've added the rest for context. So I'm creating a template repo for pipelines, which would look a bit like this: pipeline-template/example/redacted.yml
Then I'm trying to consume this via another repo that has this file in it. pull-request/ci/config.yml
The wider idea is I'm trying to make buildpacks but it's likely that the list of variables is going to grow pretty quickly, i.e. from having
Thus the question is, can I set a var that would be overwritten via var_files sections? Is there a hierarchy here? I feel like I've read this in the docs somewhere before but now I can't find it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hmm, it looks like we don't explicitly document a precedence between If we're to match the documented behavior of However, according to the current code...: concourse/atc/exec/set_pipeline_step.go Lines 179 to 196 in fab3de1 It looks like we build up a list that looks like [vars, file1, file2] which I don't think can possibly satisfy both of these conditions at once, since we kind of expect some sort of order like "vars > file2 > file1". Thankfully the step is still experimental, so I think we can change this behavior without too much trouble if we find that behavior to be desired. Would you agree that that precedence is what you're trying to achieve? |
Beta Was this translation helpful? Give feedback.
Hmm, it looks like we don't explicitly document a precedence between
vars
andvar_files
, and that may be because we just haven't run into that question yet. Intuitively I would expect later-listed entries invar_files
to take precedence over earlier-listed entries invar_files
, but I'm not sure what I would expect betweenvars
andvar_files
.If we're to match the documented behavior of
fly set-pipeline -l foo.yml -v foo=bar
, we should havevars
take precedence overvar_files
.However, according to the current code...:
concourse/atc/exec/set_pipeline_step.go
Lines 179 to 196 in fab3de1