teleport 1.3.2 (new formula)

Closes #10854.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Brendan Germain 2017-03-10 11:33:50 -05:00 committed by FX Coudert
parent 6300525c35
commit 2b24074401

50
Formula/teleport.rb Normal file
View file

@ -0,0 +1,50 @@
class Teleport < Formula
desc "Modern SSH server for teams managing distributed infrastructure"
homepage "https://gravitational.com/teleport"
url "https://github.com/gravitational/teleport/archive/v1.3.2.tar.gz"
sha256 "2f2f5aa019c99d1a829f16745aa6d81778945ca29b3e936cc9117aac832e12e1"
depends_on "go" => :build
depends_on "godep" => :build
def install
ENV["GOOS"] = "darwin"
ENV["GOARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
ENV["GOPATH"] = buildpath
ENV["GOROOT"] = Formula["go"].opt_libexec
(buildpath / "src/github.com/gravitational/teleport").install buildpath.children
ln_s buildpath/"src", buildpath / "src/github.com/gravitational/teleport"
cd "src/github.com/gravitational/teleport" do
system "godep", "restore"
ENV.deparallelize { system "make", "release" }
system "/usr/bin/tar", "-xvf", "teleport-v#{version}-#{ENV["GOOS"]}-#{ENV["GOARCH"]}-bin.tar.gz"
cd "teleport" do
bin.install %w[teleport tctl tsh]
prefix.install_metafiles
end
end
end
test do
assert_match version.to_s, shell_output("#{bin}/teleport version")
assert_match version.to_s, shell_output("#{bin}/tctl version")
assert_match version.to_s, shell_output("#{bin}/tsh version")
(testpath/"config.yml").write shell_output("#{bin}/teleport configure")
.gsub("0.0.0.0", "127.0.0.1")
.gsub("/var/lib/teleport", testpath)
.gsub("/var/run", testpath)
.gsub(/https_(.*)/, "")
begin
pid = spawn("#{bin}/teleport start -c #{testpath}/config.yml")
sleep 5
system "/usr/bin/curl", "--insecure", "https://localhost:3080"
system "/usr/bin/nc", "-z", "localhost", "3022"
system "/usr/bin/nc", "-z", "localhost", "3023"
system "/usr/bin/nc", "-z", "localhost", "3025"
ensure
Process.kill(9, pid)
end
end
end