Created
April 15, 2013 19:08
-
-
Save andrewgross/5390519 to your computer and use it in GitHub Desktop.
Standard Remote File Download Pattern
This file contains 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
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