Created
February 27, 2012 22:07
-
-
Save fujin/1927438 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
bash 'install science app' do | |
installed_version_file = "#{app[:base_dir]}/.#{app[:version]}-installed" | |
cwd Chef::Config[:file_cache_path] | |
code <<-BASH | |
tar zxf #{app[:tarball]} -C #{app[:deploy_to]} | |
cp #{app[:tarball]} #{app[:deploy_to]} | |
touch #{installed_version_file} | |
BASH | |
not_if { ::File.exist?(installed_version_file) } | |
end | |
ruby_block "get digest" do | |
block do | |
requirements = File.open(app[:requirements_file],"rb") | |
digest = Digest::MD5.hexdigest(requirements.read) | |
virtual_env_tarball = "virtual_env-#{digest}.tgz" | |
end | |
action :create | |
end | |
remote_file "#{Chef::Config[:file_cache_path]}/#{virtual_env_tarball}" do | |
source "#{node[:virtual_env][:base_url]}/#{digest}/#{virtual_env_tarball}" | |
mode 0644 | |
action :create_if_missing | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment