We don’t yet have a generic list or collection type. One issue is that we have been hesitant to put looping constructs directly in our yaml for fear of creating a yaml-based programming language. That said, it’s clear that some way to pass multiple values would be useful, so it’s something we have on our list of improvements. Curious: how would you envision the syntax looking when you use a list? We could potentially pass it through serialized for use in shell commands, but that is a bit messier than we’d like.
I’m used to dealing with the Go text/template package, in fact, the tool I’m trying to Orb-ify is https://github.com/hairyhenderson/gomplate, which is a template renderer that uses the text/template syntax.
So I’d imagine a syntax like this:
commands:
foo:
parameters:
alist:
type: list
steps:
- run: |
<< range parameters.alist >>echo "param is << . >>";<< end >>
jobs:
- foo_job:
- myorb/foo:
alist:
- first
- second
This would output:
param is first
param is second
This is just off the top of my head, and probably isn’t as intuitive to folks who aren’t familiar with the text/template syntax!
I only mention this because of the specific example you used here @hairyhenderson, because I know this isn’t quite what you’re looking for in a broader sense, but you can use the stepsparameter type to allow folks to pass a list/collection—as long as it’s a list of steps. Which would get you to your example, although it’s not quite as DRY as what you’ve outlined here.
Can you (or anyone else on the thread) create an idea in our Ideas Portal (if one doesn’t exist already) so we can formally track it as a feature request?