Skip to content

Commit

Permalink
consul 1.0.3
Browse files Browse the repository at this point in the history
Closes #23255.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
  • Loading branch information
commitay authored and ilovezfs committed Jan 25, 2018
1 parent 0218d0a commit 86d415c
Showing 1 changed file with 59 additions and 8 deletions.
67 changes: 59 additions & 8 deletions Formula/consul.rb
@@ -1,9 +1,11 @@
require "language/go"

class Consul < Formula
desc "Tool for service discovery, monitoring and configuration"
homepage "https://www.consul.io"
url "https://github.com/hashicorp/consul.git",
:tag => "v1.0.2",
:revision => "b55059fc3d0327c92c41431e57dfd2df3f956b03"
:tag => "v1.0.3",
:revision => "48f3dd5642374d079f5a64359023fb8318eb81cc"

head "https://github.com/hashicorp/consul.git",
:shallow => false
Expand All @@ -16,20 +18,69 @@ class Consul < Formula
end

depends_on "go" => :build
depends_on "gox" => :build

go_resource "github.com/axw/gocov" do
url "https://github.com/axw/gocov.git",
:revision => "3a69a0d2a4ef1f263e2d92b041a69593d6964fe8"
end

go_resource "github.com/elazarl/go-bindata-assetfs" do
url "https://github.com/elazarl/go-bindata-assetfs.git",
:revision => "30f82fa23fd844bd5bb1e5f216db87fd77b5eb43"
end

go_resource "github.com/jteeuwen/go-bindata" do
url "https://github.com/jteeuwen/go-bindata.git",
:revision => "a0ff2567cfb70903282db057e799fd826784d41d"
end

go_resource "github.com/magiconair/vendorfmt" do
url "https://github.com/magiconair/vendorfmt.git",
:revision => "0fde667441ebc14dbd64a1de758ab656b78c607b"
end

go_resource "github.com/matm/gocov-html" do
url "https://github.com/matm/gocov-html.git",
:revision => "f6dd0fd0ebc7c8cff8b24c0a585caeef250627a3"
end

go_resource "golang.org/x/tools" do
url "https://go.googlesource.com/tools.git",
:branch => "release-branch.go1.9"
end

def install
# Avoid running `go get`
inreplace "GNUmakefile", "go get -u -v $(GOTOOLS)", ""

ENV["GOPATH"] = buildpath
contents = Dir["{*,.git,.gitignore}"]
gopath = buildpath/"gopath"
(gopath/"src/github.com/hashicorp/consul").install contents
(buildpath/"src/github.com/hashicorp/consul").install contents

ENV.prepend_create_path "PATH", buildpath/"bin"
Language::Go.stage_deps resources, buildpath/"src"

ENV["GOPATH"] = gopath
ENV.prepend_create_path "PATH", gopath/"bin"
build_tools = [
"github.com/axw/gocov/gocov",
"github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs",
"github.com/jteeuwen/go-bindata/go-bindata",
"github.com/magiconair/vendorfmt/cmd/vendorfmt",
"github.com/matm/gocov-html",
"golang.org/x/tools/cmd/cover",
"golang.org/x/tools/cmd/stringer",
]

build_tools.each do |tool|
cd "src/#{tool}" do
system "go", "install"
end
end

cd gopath/"src/github.com/hashicorp/consul" do
cd "src/github.com/hashicorp/consul" do
system "make"
bin.install "bin/consul"
prefix.install_metafiles
zsh_completion.install "contrib/zsh-completion/_consul"
end
end

Expand Down

0 comments on commit 86d415c

Please sign in to comment.