Merge branch 'peco-to-fzf' of kazu634/itamae into master
This commit is contained in:
commit
f510a8a7a3
|
@ -0,0 +1,12 @@
|
|||
git '/home/kazu634/repo/fzf' do
|
||||
repository 'https://github.com/junegunn/fzf.git'
|
||||
user 'kazu634'
|
||||
end
|
||||
|
||||
link '/home/kazu634/.fzf' do
|
||||
to '/home/kazu634/repo/fzf'
|
||||
end
|
||||
|
||||
execute '/home/kazu634/.fzf/install --bin' do
|
||||
user 'kazu634'
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
# -------------------------------------------
|
||||
# Specifying the default settings:
|
||||
# -------------------------------------------
|
||||
node.reverse_merge!({
|
||||
'peco' => {
|
||||
'url' => 'https://github.com/peco/peco/releases/download/',
|
||||
'tarball' => 'peco_linux_amd64.tar.gz',
|
||||
'prefix' => '/usr/local'
|
||||
}
|
||||
})
|
|
@ -1,45 +0,0 @@
|
|||
include_recipe './attributes.rb'
|
||||
|
||||
# Calculate the latest peco version:
|
||||
peco_url = ''
|
||||
|
||||
begin
|
||||
require 'net/http'
|
||||
|
||||
uri = URI.parse('https://github.com/peco/peco/releases/latest')
|
||||
|
||||
Timeout.timeout(3) do
|
||||
response = Net::HTTP.get_response(uri)
|
||||
|
||||
vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)}
|
||||
|
||||
peco_url = "#{node['peco']['url']}/#{vtag}/#{node['peco']['tarball']}"
|
||||
end
|
||||
rescue
|
||||
# Abort the chef client process:
|
||||
raise 'Cannot connect to http://github.com.'
|
||||
end
|
||||
|
||||
# Download:
|
||||
TMP = "/tmp/#{node['peco']['tarball']}"
|
||||
|
||||
execute "wget #{peco_url} -O #{TMP}"
|
||||
|
||||
# Install:
|
||||
INSTALLDIR = '/opt/peco/bin/'
|
||||
TARGETDIR = '/usr/local/bin/'
|
||||
|
||||
directory INSTALLDIR do
|
||||
action :create
|
||||
end
|
||||
|
||||
execute "tar zxf #{TMP} -C #{INSTALLDIR} --strip-components 1" do
|
||||
action :run
|
||||
end
|
||||
|
||||
# Make a symlink:
|
||||
link "#{TARGETDIR}/peco" do
|
||||
user 'root'
|
||||
to "#{INSTALLDIR}/peco"
|
||||
force true
|
||||
end
|
|
@ -4,6 +4,6 @@ include_recipe '../cookbooks/supervisor/default.rb'
|
|||
include_recipe '../cookbooks/monit/default.rb'
|
||||
include_recipe '../cookbooks/consul/default.rb'
|
||||
include_recipe '../cookbooks/consul-template/default.rb'
|
||||
include_recipe '../cookbooks/peco/default.rb'
|
||||
include_recipe '../cookbooks/fzf/default.rb'
|
||||
include_recipe '../cookbooks/fluentd/default.rb'
|
||||
include_recipe '../cookbooks/prometheus/default.rb'
|
||||
|
|
Loading…
Reference in New Issue