Skip to content

Instantly share code, notes, and snippets.

@Drewzar
Created September 27, 2011 21:24
Show Gist options
  • Save Drewzar/1246290 to your computer and use it in GitHub Desktop.
Save Drewzar/1246290 to your computer and use it in GitHub Desktop.
move_bins = []
node[:redis][:bins].each { |bin|
unless (File.exists?("#{node[:redis][:dir]}/bin/#{bin}") && File.exists?("/#{BASE}/src/redis-#{node[:redis][:version]}/src/#{bin}")) && File.read("#{node[:redis][:dir]}/bin/#{bin}") == File.read("/#{BASE}/src/redis-#{node[:redis][:version]}/src/#{bin}")
move_bins << "cp src/#{bin} #{node[:redis][:dir]}/bin/"
end
}
unless move_bins.size == 0
Bash "stop redis" do
code "/etc/init.d/redis stop"
ignore_failure true
end
bash "set_up_redis" do
cwd "/#{BASE}/src/redis-#{node[:redis][:version]}"
code <<-EOH
#{move_bins.join("; ")}
EOH
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment