thought-machine / pleasings

Addons & new build rules for Please
Apache License 2.0
98 stars 39 forks source link

Terraform: Support colocation of modules with the same basename #91

Closed VJftw closed 2 years ago

VJftw commented 2 years ago

This PR fixes support for the colocation of Terraform modules that have the same basename. Currently, this Terraform tool only copies the basename of the directory name, into the colocated ./modules/ folder in terraform_roots. For example, the current behaviour is:

This means that any other modules with the same basename will clash, For example:

This PR fixes this by changing the behaviour to:

I've also added another exclusion pattern for *.tfstate files to not be removed from /tmp/please/... so that people can still use non-remote terraform state (with its disadvantages) for demoing/testing purposes.

lambchr commented 2 years ago

changes lgtm, will give it a tick when the CircleCI tests pass :)

Tatskaari commented 2 years ago

changes lgtm, will give it a tick when the CircleCI tests pass :)

CircleCI tests are a little unloved. I'm planning to move things out of this repo into their own plugins, a bit like this: https://github.com/please-build/proto-rules

Happy to land this if the code looks good. We can also talk about migtating this to thought-machine/terraform-rules or something.

VJftw commented 2 years ago

I'm planning to move things out of this repo into their own plugins, a bit like this: https://github.com/please-build/proto-rules We can also talk about migtating this to thought-machine/terraform-rules or something.

Awesome! I'm keen for this too, really excited to see what we can do with the new plugin style of things too, I can imagine this being much easier to maintain 👌