2019-05-17 03:37:03 +00:00
|
|
|
class Atlantis < Formula
|
|
|
|
desc "Terraform Pull Request Automation tool"
|
2019-05-24 09:31:15 +00:00
|
|
|
homepage "https://www.runatlantis.io/"
|
2019-07-13 05:37:56 +00:00
|
|
|
url "https://github.com/runatlantis/atlantis/archive/v0.8.3.tar.gz"
|
|
|
|
sha256 "26304b0510544ec883f0bb08f7c60794062b4930e6cbaa3396f6d0e66aa813e0"
|
2019-05-20 16:34:34 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-07-13 05:46:15 +00:00
|
|
|
sha256 "0b4f35f1c7b69bdfd5c197d31f21731ccf9358e61421a4b341e0f6365c7f2c08" => :mojave
|
|
|
|
sha256 "3cc4b1a987fb204b3b5accc69c6a3695a591de545b65278c86ff8bf33921d960" => :high_sierra
|
|
|
|
sha256 "263e3915c91c290e259d52ecfc979afdaaddf99ab10be60762594e3fa5d30f7d" => :sierra
|
2019-05-20 16:34:34 +00:00
|
|
|
end
|
|
|
|
|
2019-05-17 03:37:03 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
depends_on "terraform"
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
dir = "src/github.com/runatlantis/atlantis"
|
|
|
|
build_dir = buildpath/dir
|
|
|
|
build_dir.install buildpath.children
|
|
|
|
|
|
|
|
cd dir do
|
|
|
|
system "go", "build", "-o", "atlantis"
|
|
|
|
bin.install "atlantis"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system bin/"atlantis", "version"
|
|
|
|
port = 4141
|
|
|
|
loglevel = "info"
|
|
|
|
gh_args = "--gh-user INVALID --gh-token INVALID --gh-webhook-secret INVALID --repo-whitelist INVALID"
|
2019-05-24 09:31:15 +00:00
|
|
|
command = bin/"atlantis server --atlantis-url http://invalid/ --port #{port} #{gh_args} --log-level #{loglevel}"
|
2019-05-17 03:37:03 +00:00
|
|
|
pid = Process.spawn(command)
|
|
|
|
system "sleep", "5"
|
|
|
|
output = `curl -vk# 'http://localhost:#{port}/' 2>&1`
|
|
|
|
assert_match %r{HTTP\/1.1 200 OK}m, output
|
|
|
|
assert_match "atlantis", output
|
|
|
|
Process.kill("TERM", pid)
|
|
|
|
end
|
|
|
|
end
|