|
| 1 | +class Burrow < Formula |
| 2 | + desc "Kafka Consumer Lag Checking" |
| 3 | + homepage "https://github.com/linkedin/Burrow" |
| 4 | + url "https://github.com/linkedin/Burrow/archive/refs/tags/v1.9.4.tar.gz" |
| 5 | + sha256 "2881112e8fb4e5a662389a582c6044ed0e3359a03e26f446b8242929a7f82423" |
| 6 | + license "Apache-2.0" |
| 7 | + head "https://github.com/linkedin/Burrow.git", branch: "master" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "63c277d2114d19c72bcd48525fefa763e967cd35b0254f41b9fd1e7e4d320cf8" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "0fd6704cb95d0e1812e76fa40e6668e1514d425f2c4f2e256153466cb5953c0f" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "4e82bd82d515ddcec9ba8dc4644989438ae266b9a0b9d56254561d4999369c4d" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "00d6a0fe41ae667421f4b20d13cbedf294cbdd0201808195bfe788c70cdc1217" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "b7ef8f3dc4e0da995455d8889a06b243a68fd850951286a43eae18c95731b467" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "c5f3ab59d96b041b0ec3941520ea39accc326d4f1d7b3262fc9e4bae54e6b50f" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + system "go", "build", *std_go_args |
| 22 | + |
| 23 | + inreplace "docker-config/burrow.toml" do |s| |
| 24 | + s.gsub!(/(kafka|zookeeper):/, "localhost:") |
| 25 | + s.sub! "docker-client", "homebrew-client" |
| 26 | + end |
| 27 | + (etc/"burrow").install "docker-config/burrow.toml" |
| 28 | + end |
| 29 | + |
| 30 | + service do |
| 31 | + run [opt_bin/"burrow", "--config-dir", etc/"burrow"] |
| 32 | + keep_alive true |
| 33 | + error_log_path var/"log/burrow.log" |
| 34 | + log_path var/"log/burrow.log" |
| 35 | + working_dir var |
| 36 | + end |
| 37 | + |
| 38 | + test do |
| 39 | + port = free_port |
| 40 | + (testpath/"burrow.toml").write <<~TOML |
| 41 | + [httpserver.default] |
| 42 | + address="localhost:#{port}" |
| 43 | + TOML |
| 44 | + spawn bin/"burrow" |
| 45 | + sleep 1 |
| 46 | + |
| 47 | + output = shell_output("curl -s localhost:#{port}/v3/kafka") |
| 48 | + assert_match "cluster list returned", output |
| 49 | + end |
| 50 | +end |
0 commit comments