defenseunicorns / maru-runner

The Unicorn Task Runner
Apache License 2.0
10 stars 1 forks source link

Call tasks within other tasks with dynamic variables #16

Open AustinAbro321 opened 8 months ago

AustinAbro321 commented 8 months ago

Is your feature request related to a problem? Please describe

I am building out a task that calls other tasks with an input. The input is dynamic, generated from a for loop, and I want to call the child task with it. I can do this with uds run but this is not ideal in a few ways.

  - name: build-pkg
    description: Run unit tests for one package
    actions:
      - cmd: cd "${PKG}" &&  go build -o ../build/${PKG} .

  - name: build-all
    description: Run unit tests in all packages
    actions:
      - task: set-modules-variable
      - cmd: |
          for dir in ${MODULES}; do
            uds run build-pkg --set PKG=$dir
          done

Describe the solution you'd like

^ This is just one idea and might not work, but I think it would be nice to have a solution that can accomplish something similar

zachariahmiller commented 1 month ago

I believe this is a duplicate of https://github.com/defenseunicorns/maru-runner/issues/82

In this case it would be setting the matrix based on a var generated in the earlier task that then loops over the options, similar to how you can do so in github