#running terraform-docs

1 messages · Page 1 of 1 (latest)

fading trench
#

Re-posting a question from @sand kernel below. Sorry Alex, your post got caught in the migration to this new forum channel.

I've been experimenting with Dagger these days, and it's frankly awesome. I'd like to move some of DX automations that I have, specially in the "realm" of pre-commit framework and terraform. For example, there are some hooks that takes care of automatically generates documentation, using terraform-docs (https://terraform-docs.io/); but running it from within the docker container, does not allow it to effectively write the changes (created/modified README.md) into the filesystem. It works perfectly fine for check/read-only things, since they run within the container, but I couldn't find an example in order to run scripts/automations/binaries (like the aforementioned terraform-docs) that can modify and write their results into the filesystem; so Dagger can also be used for replacing some hooks like this.

PS: Newbie on dagger; so perhaps I'm missing some fundamentals in my former question.

fading trench
# fading trench Re-posting a question from <@474225391599353866> below. Sorry Alex, your post go...

Thanks for the kind words!

First, this is mostly a documentation issue. What you want to do is possible in both the CUE SDK and the upcoming Go SDK (codename "cloak").

Assuming you're looking to do this in CUE (the only option on the current Dagger 0.2), you're looking for client: filesystem, see https://docs.dagger.io/1203/client

In the upcoming Go SDK, this will be possible as well, happy to go into more detail (with some help with the Go SDK devs 🙂 if that's interesting to you.

dagger.#Plan has a client field that allows interaction with the local machine where the dagger command line client is run. You can: