Homebrewでterraform0.12を導入する
背景
- Terraformを使おうとしたところver. 0.11からver. 0.12でConfiguration Languageの仕様が変わるとのこと。
- Homebrewでver. 0.12をインストールしようとしましたが、まだ正式リリースされていないためインストール不可…
- productionで使うわけじゃないので、仕様が変わっても問題ない。
- 手でバイナリを配置すると管理できなくなるので集約したい。
解決方法
brew installにはHEADオプションといって、最新版のコードからビルドしてインストールするオプションがあるようです。 今回はこれを使ってみました。
# terraform ver. 0.11の削除 ~ ❯❯❯ brew uninstall terraform Uninstalling /usr/local/Cellar/terraform/0.11.13... (6 files, 120.6MB) # 最新版のterraformのインストール ~ ❯❯❯ brew install terraform --HEAD Updating Homebrew... ==> Installing dependencies for terraform: go and gox ==> Installing terraform dependency: go ==> Downloading https://homebrew.bintray.com/bottles/go-1.12.1.mojave.bottle.tar.gz ######################################################################## 100.0% ==> Pouring go-1.12.1.mojave.bottle.tar.gz 🍺 /usr/local/Cellar/go/1.12.1: 9,794 files, 452.6MB ==> Installing terraform dependency: gox ==> Downloading https://homebrew.bintray.com/bottles/gox-0.4.0.mojave.bottle.tar.gz ######################################################################## 100.0% ==> Pouring gox-0.4.0.mojave.bottle.tar.gz 🍺 /usr/local/Cellar/gox/0.4.0: 5 files, 3.3MB ==> Installing terraform --HEAD ==> Cloning https://github.com/hashicorp/terraform.git Cloning into '/Users/<username>/Library/Caches/Homebrew/terraform--git'... Checking out files: 100% (6012/6012), done. ==> Checking out branch master Already on 'master' Your branch is up-to-date with 'origin/master'. ==> make tools test bin 🍺 /usr/local/Cellar/terraform/HEAD-4d52999: 6 files, 50.2MB, built in 6 minutes 34 seconds Removing: /Users/<username>/Library/Caches/Homebrew/terraform--0.11.13.mojave.bottle.tar.gz... (25.4MB) # バージョンの確認 ~ ❯❯❯ terraform --version Terraform v0.12.0-dev
環境
- OS: mac OS Mojave 10.14.4
- Homebrew: 2.0.6