homebrew-core/Formula/pulumi.rb
2019-01-24 15:14:37 +01: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.16.11",
:revision => "378bae27d83e649e482beed8fe33be20bd3c7805"
revision 1
bottle do
cellar :any_skip_relocation
sha256 "9b138c2ae62c3a92181727632a902a73dad451dbd0d0b0555dd53675815b1da1" => :mojave
sha256 "b4667ddc2a1c9b48fc88b561badb3fc8fc4411a2d2633da9c2f955612585474a" => :high_sierra
sha256 "1788a7b7bae312f06ae5003178ce7b61dc18cdb7c4f2fead79dce94fbb59b233" => :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