Skip to content

Commit

Permalink
Merge pull request #5 from ejima/master
Browse files Browse the repository at this point in the history
Fix issues with source install
  • Loading branch information
John Bellone committed May 7, 2014
2 parents 295fcc9 + d5e4215 commit c978c46
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'0.2.0_linux_amd64' => '2802ce8e173ee37e1a1e992ba230963e09d4b41ce4ac60c1222714c036787b4f',
'0.2.0_windows_386' => '353da0b0321293d81a1e2351b7bc6902d462c6573e44a4495d1a61df6b0a0179'
}
repository node[:consul][:source_revision] = "master"

# Service attributes
default[:consul][:service_mode] = 'bootstrap'
Expand Down
27 changes: 17 additions & 10 deletions recipes/source_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,24 @@

include_recipe 'golang::default'

# TODO: Regular expression to support branches?
source_version = "v#{node[:consul][:version]}"
directory "#{node[:go][:gopath]}/src/github.com/hashicorp" do
owner 'root'
group 'root'
mode 00755
recursive true
action :create
end

env = {
'PATH' => "#{node[:go][:install_dir]}/go/bin:#{node[:go][:install_dir]}/bin:#{node[:go][:gobin]}:/usr/bin",
'GOPATH' => node[:go][:gopath]
}
git "#{node[:go][:gopath]}/src/github.com/hashicorp/consul" do
repository "https://github.com/hashicorp/consul.git"
reference node[:consul][:source_revision]
action :checkout
end

ark 'consul' do
has_binaries ['bin/consul']
environment env
url URI.join('https://github.com/hashicorp/consul/archive/', "#{source_version}.tar.gz").to_s
golang_package 'github.com/hashicorp/consul' do
action :install
end

link "#{node[:consul][:install_dir]}/consul" do
to "#{default[:go][:gobin]}/consul"
end

0 comments on commit c978c46

Please sign in to comment.