Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Formula/consul.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class Consul < Formula

depends_on "go" => :build

# Support go 1.17, remove after next release
patch do
url "https://github.com/hashicorp/consul/commit/e43cf462679b6fdd8b15ac7891747e970029ac4a.patch?full_index=1"
sha256 "4f0edde54f0caa4c7290b17f2888159a4e0b462b5c890e3068a41d4c3582ca2f"
end

def install
system "go", "build", *std_go_args(ldflags: "-s -w")
end
Expand All @@ -38,7 +44,7 @@ def install
fork do
# most ports must be free, but are irrelevant to this test
system(
"#{bin}/consul",
bin/"consul",
"agent",
"-dev",
"-bind", "127.0.0.1",
Expand All @@ -56,7 +62,7 @@ def install

k = "brew-formula-test"
v = "value"
system "#{bin}/consul", "kv", "put", "-http-addr", "127.0.0.1:#{http_port}", k, v
assert_equal v, shell_output("#{bin}/consul kv get -http-addr 127.0.0.1:#{http_port} #{k}").chomp
system bin/"consul", "kv", "put", "-http-addr", "127.0.0.1:#{http_port}", k, v
assert_equal v, shell_output(bin/"consul kv get -http-addr 127.0.0.1:#{http_port} #{k}").chomp
end
end