Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with source install #5

Merged
merged 1 commit into from
May 7, 2014
Merged
Show file tree
Hide file tree
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
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