terraform 0.7.6
Closes #5914. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
4106f2782c
commit
5c3ae2cfa2
1 changed files with 20 additions and 12 deletions
|
@ -3,8 +3,8 @@ require "language/go"
|
||||||
class Terraform < Formula
|
class Terraform < Formula
|
||||||
desc "Tool to build, change, and version infrastructure"
|
desc "Tool to build, change, and version infrastructure"
|
||||||
homepage "https://www.terraform.io/"
|
homepage "https://www.terraform.io/"
|
||||||
url "https://github.com/hashicorp/terraform/archive/v0.7.5.tar.gz"
|
url "https://github.com/hashicorp/terraform/archive/v0.7.6.tar.gz"
|
||||||
sha256 "996411c27c2754005583db2283762d66aa453e6d7b9f49a39db62660307a3a99"
|
sha256 "549a983d248549d5ec4adb3224c27cc3e6fbe87e1654e6851fe6e92d1c953cb1"
|
||||||
head "https://github.com/hashicorp/terraform.git"
|
head "https://github.com/hashicorp/terraform.git"
|
||||||
|
|
||||||
bottle do
|
bottle do
|
||||||
|
@ -17,8 +17,10 @@ class Terraform < Formula
|
||||||
depends_on "go" => :build
|
depends_on "go" => :build
|
||||||
|
|
||||||
terraform_deps = %w[
|
terraform_deps = %w[
|
||||||
github.com/mitchellh/gox 770c39f64e66797aa46b70ea953ff57d41658e40
|
github.com/mitchellh/gox c9740af9c6574448fd48eb30a71f964014c7a837
|
||||||
github.com/mitchellh/iochan 87b45ffd0e9581375c491fef3d32130bb15c5bd7
|
github.com/mitchellh/iochan 87b45ffd0e9581375c491fef3d32130bb15c5bd7
|
||||||
|
github.com/kisielk/errcheck 9c1292e1c962175f76516859f4a88aabd86dc495
|
||||||
|
github.com/kisielk/gotool 5e136deb9b893bbe6c8f23236ff4378b7a8a0dbb
|
||||||
]
|
]
|
||||||
|
|
||||||
terraform_deps.each_slice(2) do |x, y|
|
terraform_deps.each_slice(2) do |x, y|
|
||||||
|
@ -29,7 +31,7 @@ class Terraform < Formula
|
||||||
|
|
||||||
go_resource "golang.org/x/tools" do
|
go_resource "golang.org/x/tools" do
|
||||||
url "https://go.googlesource.com/tools.git",
|
url "https://go.googlesource.com/tools.git",
|
||||||
:revision => "977844c7af2aa555048a19d28e9fe6c392e7b8e9"
|
:revision => "26c35b4dcf6dfcb924e26828ed9f4d028c5ce05a"
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
@ -52,21 +54,27 @@ class Terraform < Formula
|
||||||
buildpath.install "stringer"
|
buildpath.install "stringer"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cd "src/github.com/kisielk/errcheck" do
|
||||||
|
system "go", "build"
|
||||||
|
buildpath.install "errcheck"
|
||||||
|
end
|
||||||
|
|
||||||
cd terrapath do
|
cd terrapath do
|
||||||
# v0.6.12 - source contains tests which fail if these environment variables are set locally.
|
# v0.6.12 - source contains tests which fail if these environment variables are set locally.
|
||||||
ENV.delete "AWS_ACCESS_KEY"
|
ENV.delete "AWS_ACCESS_KEY"
|
||||||
ENV.delete "AWS_SECRET_KEY"
|
ENV.delete "AWS_SECRET_KEY"
|
||||||
|
|
||||||
terraform_files = `go list ./...`.lines.map { |f| f.strip unless f.include? "/vendor/" }.compact
|
# Runs format check and test suite via makefile
|
||||||
system "go", "test", *terraform_files
|
ENV.deparallelize { system "make", "test", "vet" }
|
||||||
|
|
||||||
mkdir "bin"
|
# Generate release binary
|
||||||
arch = MacOS.prefer_64_bit? ? "amd64" : "386"
|
arch = MacOS.prefer_64_bit? ? "amd64" : "386"
|
||||||
system "gox",
|
ENV["XC_OS"] = "darwin"
|
||||||
"-arch", arch,
|
ENV["XC_ARCH"] = arch
|
||||||
"-os", "darwin",
|
system "make", "bin"
|
||||||
"-output", "bin/terraform-{{.Dir}}", *terraform_files
|
|
||||||
bin.install "bin/terraform-terraform" => "terraform"
|
# Install release binary
|
||||||
|
bin.install "pkg/darwin_#{arch}/terraform"
|
||||||
zsh_completion.install "contrib/zsh-completion/_terraform"
|
zsh_completion.install "contrib/zsh-completion/_terraform"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue