Last active
August 29, 2015 14:16
-
-
Save y13i/8bf87d220e9f0c120c76 to your computer and use it in GitHub Desktop.
Embulkをシステムワイドにインストールするrecipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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