itamae/cookbooks/embulk/install.rb

38 lines
695 B
Ruby
Raw Permalink Normal View History

2019-03-03 08:50:49 +00:00
# Create installation directory:
directory node['embulk']['install_path'] do
owner 'root'
group 'root'
mode '755'
end
2021-06-19 11:13:50 +00:00
URL = "#{node['embulk']['base_binary_url']}#{node['embulk']['version']}/embulk-#{node['embulk']['version']}#{node['embulk']['extension']}"
2019-03-03 08:50:49 +00:00
TARGET = "#{node['embulk']['install_path']}/embulk"
# Download and install:
2021-06-19 11:13:50 +00:00
execute "wget #{URL} -O #{TARGET}"
2019-03-03 08:50:49 +00:00
file TARGET do
owner 'root'
group 'root'
mode '755'
end
# Create link:
link '/usr/local/bin/embulk' do
user 'root'
to TARGET
2021-06-19 11:14:07 +00:00
force true
2019-03-03 08:50:49 +00:00
end
2022-07-18 13:21:35 +00:00
case node['platform_version'].to_f
when 22.04
package 'openjdk-8-jre' do
action :install
end
else
package 'default-jre' do
action :install
end
2019-03-03 08:50:49 +00:00
end