Closed bodymindarts closed 8 years ago
Can you provide more of your templates? I have a feeling you can do this with (( inline ))
yeah I didn’t explain it well sorry (writting tickets while on client call)… the issue is we can do:
job:
name: (( grab <some-name> ))
but with the pluralized version it needs to be:
jobs:
<some-name>:
(etc)
is there a way to use spruce to get a grabbed field and have it be the key of a map (instead of a value)
Sadly, there is not. Feel free to open a PR against https://github.com/geofffranks/spruce to see if it can be modified to do so.
In the meantime, what if we added an optional name:
attribute to all of the entries, and have that 'default' to the key if not specified?
So:
properties:
shield:
jobs:
default:
name: (( grab name ))
# etc.
So when specifying many jobs like:
properties:
shield:
jobs:
joba:
name: a-job
jobb:
name: b-job
The value under the name:
attribute would win over the key that the attrs are under?
Yes. PR forthcoming.
We have shield deployed to multiple environments and configure the agent job at site level as follows:
Now that only plural version of
jobs
key is supported we cannot dynamically determin the job name when merging the templates via spruce / genesis.