зеркало из https://github.com/mozilla/labs-vcap.git
[dev_setup] Fix memcached service chef cookbook.
- change libevent source url (cf_remote_file does not support download from https and redirect yet). - add checksums (for cf_remote_file). - use dev_setup cache. Change-Id: I3ef634af15d99d44e12287427f8e4dbaf8153509
This commit is contained in:
Родитель
d51e0036e4
Коммит
2d4db88764
|
@ -1,10 +1,15 @@
|
|||
include_attribute "deployment"
|
||||
default[:libevent][:version] = "2.0.19"
|
||||
default[:libevent][:source] = "http://cloud.github.com/downloads/libevent/libevent/libevent-#{node[:libevent][:version]}-stable.tar.gz"
|
||||
default[:memcached][:version] = "1.4.13"
|
||||
default[:memcached][:path] = File.join(node[:deployment][:home], "deploy", "memcached")
|
||||
default[:memcached][:source] = "http://memcached.googlecode.com/files/memcached-#{node[:memcached][:version]}.tar.gz"
|
||||
default[:memcached][:runner] = node[:deployment][:user]
|
||||
default[:memcached][:password] = "memcached"
|
||||
|
||||
default[:memcached][:checksums][:libevent] = "1591fb411a67876a514a33df54b85417b31e01800284bcc6894fc410c3eaea21"
|
||||
default[:memcached][:checksums][:memcached] = "cb0b8b87aa57890d2327906a11f2f1b61b8d870c0885b54c61ca46f954f27e29"
|
||||
|
||||
default[:memcached_node][:index] = "0"
|
||||
default[:memcached_node][:capacity] = "5"
|
||||
default[:memcached_node][:token] = "changememcachedtoken"
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
remote_file File.join("", "tmp", "libevent-#{node[:libevent][:version]}-stable.tar.gz") do
|
||||
libevent_tarball_path = File.join(node[:deployment][:setup_cache], "libevent-#{node[:libevent][:version]}-stable.tar.gz")
|
||||
cf_remote_file libevent_tarball_path do
|
||||
owner node[:deployment][:user]
|
||||
source "https://github.com/downloads/libevent/libevent/libevent-#{node[:libevent][:version]}-stable.tar.gz"
|
||||
not_if { ::File.exists?(File.join("", "tmp", "libevent-#{node[:libevent][:version]}-stable.tar.gz")) }
|
||||
source node[:libevent][:source]
|
||||
checksum node[:memcached][:checksums][:libevent]
|
||||
end
|
||||
|
||||
remote_file File.join("", "tmp", "memcached-#{node[:memcached][:version]}.tar.gz") do
|
||||
memcached_tarball_path = File.join(node[:deployment][:setup_cache], "memcached-#{node[:memcached][:version]}.tar.gz")
|
||||
cf_remote_file memcached_tarball_path do
|
||||
owner node[:deployment][:user]
|
||||
source "http://memcached.googlecode.com/files/memcached-#{node[:memcached][:version]}.tar.gz"
|
||||
not_if { ::File.exists?(File.join("", "tmp", "memcached-#{node[:memcached][:version]}.tar.gz")) }
|
||||
source node[:memcached][:source]
|
||||
checksum node[:memcached][:checksums][:memcached]
|
||||
end
|
||||
|
||||
directory "#{node[:memcached][:path]}" do
|
||||
|
@ -30,7 +32,7 @@ bash "Compile libevent" do
|
|||
cwd File.join("", "tmp")
|
||||
user node[:deployment][:user]
|
||||
code <<-EOH
|
||||
tar xzf libevent-#{node[:libevent][:version]}-stable.tar.gz
|
||||
tar xzf #{libevent_tarball_path}
|
||||
cd libevent-#{node[:libevent][:version]}-stable
|
||||
./configure --prefix=`pwd`/tmp
|
||||
make
|
||||
|
@ -45,7 +47,7 @@ bash "Install memcached" do
|
|||
cwd File.join("", "tmp")
|
||||
user node[:deployment][:user]
|
||||
code <<-EOH
|
||||
tar xzf memcached-#{node[:memcached][:version]}.tar.gz
|
||||
tar xzf #{memcached_tarball_path}
|
||||
cd memcached-#{node[:memcached][:version]}
|
||||
./configure --with-libevent=../libevent-#{node[:libevent][:version]}-stable/tmp LDFLAGS="-static"
|
||||
make
|
||||
|
|
Загрузка…
Ссылка в новой задаче