homebrew-core/Formula/pulumi.rb
2019-07-13 14:37:25 +02:00

47 lines
1.5 KiB
Ruby

class Pulumi < Formula
desc "Cloud native development platform"
homepage "https://pulumi.io/"
url "https://github.com/pulumi/pulumi.git",
:tag => "v0.17.22",
:revision => "997516a7b8a7e8e476da622be8e51b417d1586bf"
bottle do
cellar :any_skip_relocation
sha256 "9f9e2a40a99255c5b3bad06bdd52f44e9a41ffff0354ffbcce84f5fd6b74cb0a" => :mojave
sha256 "b435e75df800578612b5fba0a87ad77b11e650e03b36877572382e3806573f6d" => :high_sierra
sha256 "0e324d8bd6cf5c15f07b1744a39d3952c3ee0a97db0366c3fd79a59d279d117e" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GO111MODULE"] = "on"
dir = buildpath/"src/github.com/pulumi/pulumi"
dir.install buildpath.children
cd dir do
system "go", "mod", "vendor"
system "make", "dist"
bin.install Dir["#{buildpath}/bin/*"]
prefix.install_metafiles
# Install bash completion
output = Utils.popen_read("#{bin}/pulumi gen-completion bash")
(bash_completion/"pulumi").write output
# Install zsh completion
output = Utils.popen_read("#{bin}/pulumi gen-completion zsh")
(zsh_completion/"_pulumi").write output
end
end
test do
ENV["PULUMI_ACCESS_TOKEN"] = "local://"
ENV["PULUMI_TEMPLATE_PATH"] = testpath/"templates"
system "#{bin}/pulumi", "new", "aws-typescript", "--generate-only",
"--force", "-y"
assert_predicate testpath/"Pulumi.yaml", :exist?, "Project was not created"
end
end