homebrew-core/Formula/pulumi.rb
2019-01-28 09:38:04 +01:00

46 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.16.12",
:revision => "e950ab1e5155f2f04881e53fcf4e07362dd6448f"
bottle do
cellar :any_skip_relocation
sha256 "13ba7103266c8968f5b75c29b5ca5c5da62b5655718033402fccd6c75fa28dd4" => :mojave
sha256 "f2808d1a1195f88ee8b40ecad8e21f22b1aa8f88debc183a145c2b4535248874" => :high_sierra
sha256 "22965a75626a5d431aafc792eec89b574668b6c81042cc196ca99de96f7f219f" => :sierra
end
depends_on "dep" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/pulumi/pulumi"
dir.install buildpath.children
cd dir do
system "dep", "ensure", "-vendor-only"
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