47 lines
1.5 KiB
Ruby
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 => "v1.3.1",
|
|
:revision => "97803a6591f8089d5067d0b60a1bb1a597fced50"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "77078c9177401f9d800f5052399b11dbad76259fb40fce8af998d3cf653076b7" => :catalina
|
|
sha256 "4e015dadc4d23d30be8a9b5c78fc5326c116f6599945ea14fd6e498f58767e70" => :mojave
|
|
sha256 "a944d4e3598f9994851bf82a3fcd3c57d9fce07f2f83ba2b2a730c05c10dce29" => :high_sierra
|
|
end
|
|
|
|
depends_on "go@1.12" => :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
|