Skip to content

Instantly share code, notes, and snippets.

@y13i
Last active August 29, 2015 14:16
Show Gist options
  • Save y13i/8bf87d220e9f0c120c76 to your computer and use it in GitHub Desktop.
Save y13i/8bf87d220e9f0c120c76 to your computer and use it in GitHub Desktop.
Embulkをシステムワイドにインストールするrecipe
attrs = {
embulk: {
install_path: "/opt/embulk",
download_url: "https://bintray.com/artifact/download/embulk/maven/embulk-0.5.2.jar",
path_export_script_path: "/etc/profile.d"
}
}
directory "#{attrs[:embulk][:install_path]}/bin" do
action :create
owner "root"
group "root"
mode "0755"
end
file "#{attrs[:embulk][:path_export_script_path]}/embulk.sh" do
action :create
owner "root"
group "root"
mode "0644"
content <<-EOS
export PATH="#{attrs[:embulk][:install_path]}/bin:$PATH"
EOS
end
execute "install embulk" do
action :run
not_if "embulk --version"
command <<-EOS
curl -o #{attrs[:embulk][:install_path]}/bin/embulk -L #{attrs[:embulk][:download_url]}
chmod +x #{attrs[:embulk][:install_path]}/bin/embulk
source #{attrs[:embulk][:path_export_script_path]}/embulk.sh
EOS
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment