homebrew-core/Formula/pulumi.rb
2019-04-08 20:54:43 +02: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.17.5",
:revision => "44292747d46095df426165975e195ddaaae3c552"
bottle do
cellar :any_skip_relocation
sha256 "f40c6f58074a6aae1c8724b57f33aed0450491aaa94873f8f0feafe30133af4b" => :mojave
sha256 "2edb6d986aa72998f134a8040aa3d82a0656f1769c9070d58683732c1bc55811" => :high_sierra
sha256 "97d61b8cf955079b96820bad05669461249232565930efaa97565632fb6f3ac0" => :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