Skip to content

Instantly share code, notes, and snippets.

@andrewgross
Created April 15, 2013 19:08
Show Gist options
  • Save andrewgross/5390519 to your computer and use it in GitHub Desktop.
Save andrewgross/5390519 to your computer and use it in GitHub Desktop.
Standard Remote File Download Pattern
url = node['redisio']['mirror']
base_name = node['redisio']['base_name']
version = node['redisio']['version']
extension = node['redisio']['artifact_type']
tarball_name = "#{base_name}#{version}"
tarball = "#{tarball_name}.#{extension}"
download_url = "#{url}/#{tarball}"
download_dir = node['redisio']['download_dir']
sha256_checksum = node['redisio']['sha256_checksum']
remote_file "Download Redis Source" do
path "#{download_dir}/#{tarball}"
source download_url
backup false
checksum sha256_checksum
notifies :run, "execute[Unpack Redis Tarball]", :immediately
end
execute "Unpack Redis Tarball" do
command "tar -xvzf #{tarball}"
action :nothing
cwd download_dir
notifies :run, "execute[Make Redis]", :immediately
end
# Make the package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment