homebrew-core/Formula/pulumi.rb
2019-07-17 09:44:41 +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.23",
:revision => "049d7cec4ec957e49a64c2b04eeda1be71c053d2"
bottle do
cellar :any_skip_relocation
sha256 "e4f517291b8b96157d4008cd988b68e9a8809e7458182c5d2c88f00304d306c4" => :mojave
sha256 "c9fea0c94eaadd51ff6425f3300381724bbc63e3e1e025b444ce74ca14eef879" => :high_sierra
sha256 "89a85ca2a26f8b5eb96f327ea6e8f8732868e9932f585d5299ffabdaeaf836a3" => :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