Skip to content

vars-based parallel tasks #1694

@dakom

Description

@dakom

if I understand correctly, the only way to have a task run different commands in parallel, and cleanly exit when the task is killed, is by using the deps feature

however, I have a variable with a list of entries:

vars:
  FOO:
    apple
    banana
    orange

I can loop over these (and I do that for other requirements), but that runs each task serially. Afaict the map feature doesn't help - since the whole point is I want it to automatically work as new entries are added - i.e. manually adding FOO.1, FOO.2 doesn't quite solve it

What I currently have to do - manually - is something like this, which of course doesn't scale as more items are added to FOO, and also breaks if any typos are introduced:

deps: [
  "internal-apple",
  "internal-banana",
  "internal-foo",
]

Would it be possible to have some sort of expansion of variables? e.g. something like:

deps: [
  "internal-{{expand .FOO}}",
  "keep-adding-more-deps-why-not"
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions