[dev_setup] Cache ruby tarballs

Ruby source tarballs are now cached to speed up repeated
installations.
  Test plan: run dev_setup without cache, with cache, and with a
corrupted cached tarball.

Change-Id: I3bd5e089d60ac9b51193f80efffa916d63fdba36
This commit is contained in:
Jesse Zhang 2012-04-09 01:50:50 -07:00
Родитель 8b0a9b9bcd
Коммит f8b05c3634
3 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -2,6 +2,7 @@ include_attribute "deployment"
default[:ruby][:version] = "1.9.2-p180"
default[:ruby][:source] = "http://ftp.ruby-lang.org//pub/ruby/1.9/ruby-#{ruby[:version]}.tar.gz"
default[:ruby][:path] = File.join(node[:deployment][:home], "deploy", "rubies", "ruby-#{ruby[:version]}")
default[:ruby][:checksums]["1.9.2-p180"] = "9027a5abaaadc2af85005ed74aeb628ce2326441874bf3d4f1a842663cde04f4"
default[:rubygems][:version] = "1.8.7"
default[:rubygems][:bundler][:version] = "1.0.18"

Просмотреть файл

@ -2,3 +2,4 @@ include_attribute "deployment"
default[:ruby18][:version] = "1.8.7-p334"
default[:ruby18][:source] = "http://ftp.ruby-lang.org//pub/ruby/1.8/ruby-#{ruby18[:version]}.tar.gz"
default[:ruby18][:path] = File.join(node[:deployment][:home], "deploy", "rubies", "ruby-#{ruby18[:version]}")
default[:ruby][:checksums]["1.8.7-p334"] = "68f68d6480955045661fab3be614c504bfcac167d070c6fdbfc9dbe2c5444bc0"

Просмотреть файл

@ -8,10 +8,10 @@ module RubyInstall
package pkg
end
remote_file File.join("", "tmp", "ruby-#{ruby_version}.tar.gz") do
remote_file File.join(node[:deployment][:setup_cache], "ruby-#{ruby_version}.tar.gz") do
owner node[:deployment][:user]
source ruby_source
not_if { ::File.exists?(File.join("", "tmp", "ruby-#{ruby_version}.tar.gz")) }
checksum node[:ruby][:checksums][ruby_version]
end
directory ruby_path do