Closed johnnyplaydrums closed 5 years ago
Just digging through the source at the moment however I think the only way you could do this is by creating your own tap and directly referencing that in your Brewfile.
tap "my-org/terraform" # optionally include the repo path if needed
brew "my-org/terraform/terraform"
See the full documentation on Taps if this might be of interest.
@jacobbednarz thanks for the quick response! That's not a bad solution, I think we can go with that solution for now. I don't know if there is a homebrew-bundle native way to handle this scenario but if not, creating our own tap will work. Would be curious if anyone out there has tried to solve this problem before.
@jacobbednarz trying your suggestion, homebrew is telling me to use switch
. I don't think homebrew-bundle has support for a switch
statement does it?
$ brew tap "johnplaydrums/terraform"
$ brew install "johnplaydrums/terraform/terraform"
Warning: johnplaydrums/terraform/terraform 0.11.7 is already installed
The currently linked version is 0.11.10
You can use `brew switch terraform 0.11.7` to link this version.
We want to enforce the 0.11.7
installment (or any other version in the future). Of course we could have our engineers run brew switch terraform 0.11.7
but we were hoping to be able to resolve all dependencies needs with just brew bundle
. Thanks again!
I think the best solution here is to use tfenv.
Thanks @colindean! If using tfenv
is the best solution to this use case I'm happy to close this issue
Yeah, tfenv is def. the best way to control what version of tf you're using.
@colindean cool thank you. Also I guess I meant the question a little more broadly than just terraform. Like should homebrew-bundle support more features to manage specific homebrew deps. (e.g. switch
support maybe?). happy to contrib / pr if there is a need
IIRC, one of the philosophies of Homebrew is that only the latest version of a formula is supported. I'm not sure we'd want to support installing old formula in this way.
@MikeMcQuaid can chime in…
We support multiple versions but not installing random versions from a Git commits which are immutable. See https://docs.brew.sh/Versions which is the supported path.
Sounds good, thank you both!
Hey! We love managing brew dependencies with homebrew-bundle but have run into a snag trying to support older versions of terraform. We need to run terraform 0.11.7, and with the homebrew cli we can do:
and I'll be set with terraform 0.11.7. But I haven't been able to figure out how to achieve that via a Brewfile. I may have missed the obvious solution but, any suggestions?
Thank you!