#Is it possible to dynamically add/call a
1 messages · Page 1 of 1 (latest)
Only in very very roundabout ways. It is possible to pass around Modules as arguments to Functions though since Module is just another type in our core API. So we can add something like module.call("cool-func", [{name: "cool-arg", value: "cool-val"}]). No type safety, but that's obviously always the trade off of being dynamic.
Curious what the use case is though either way
We have an azure devops based setup that has a yaml file in each repo that looks like this:
...
profiles:
- profile: docker@1
- profile: terraform@1
inputs:
path: ./terraform
depends_on:
deploy: [docker]
destroy: [helm]
- profile: helm@1
depends_on:
deploy: [terraform]
...
Where under the hood each profile can expose hooks for different phases of the pipeline: build, predeploy, deploy, postdeploy, predestroy, destroy, postdestroy, and the framework runs the jobs in the appropriate order for each phase (for each env).
I was looking to see if something similar could be built using dagger as a backend, but would need to be able to dynamically load modules for each profile based on said yaml file at runtime