From 6739b3ce5c69af05aedf69b46a46e0aead261b9b Mon Sep 17 00:00:00 2001 From: jabenninghoff Date: Sun, 12 Feb 2017 21:18:41 -0600 Subject: [PATCH] collector-sidecar 0.0.9 (new formula) Closes #9910. Signed-off-by: Mike McQuaid --- Formula/collector-sidecar.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/collector-sidecar.rb diff --git a/Formula/collector-sidecar.rb b/Formula/collector-sidecar.rb new file mode 100644 index 0000000000..8748d382af --- /dev/null +++ b/Formula/collector-sidecar.rb @@ -0,0 +1,31 @@ +class CollectorSidecar < Formula + desc "Manage log collectors through Graylog" + homepage "https://github.com/Graylog2/collector-sidecar" + url "https://github.com/Graylog2/collector-sidecar/archive/0.0.9.tar.gz" + sha256 "a854d84bf65e3fb9409743869701dab5c059d14d0b615acd14c8923bef30bc9f" + + depends_on "glide" => :build + depends_on "go" => :build + depends_on :hg => :build + depends_on "filebeat" => :run + + def install + ENV["GOPATH"] = buildpath + ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}" + (buildpath/"src/github.com/Graylog2/collector-sidecar").install buildpath.children + cd "src/github.com/Graylog2/collector-sidecar" do + inreplace "main.go", "/etc", etc + inreplace "collector_sidecar.yml", "/usr", HOMEBREW_PREFIX + inreplace "collector_sidecar.yml", "/etc", etc + inreplace "collector_sidecar.yml", "/var", var + system "glide", "install" + system "make", "build" + (etc/"graylog/collector-sidecar").install "collector_sidecar.yml" + bin.install "graylog-collector-sidecar" + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/graylog-collector-sidecar -version") + end +end