Rakefile option for any additional rsync arguments

Added variable `rsync_args`
This commit is contained in:
Johan Svensson 2012-12-09 19:04:41 +01:00
parent 2b67270f96
commit 916b87a545

View File

@ -8,6 +8,7 @@ ssh_user = "user@domain.com"
ssh_port = "22" ssh_port = "22"
document_root = "~/website.com/" document_root = "~/website.com/"
rsync_delete = false rsync_delete = false
rsync_args = "" # Any extra arguments to pass to rsync
deploy_default = "rsync" deploy_default = "rsync"
# This will be configured for you when you run config_deploy # This will be configured for you when you run config_deploy
@ -237,7 +238,7 @@ task :rsync do
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'" exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
end end
puts "## Deploying website via Rsync" puts "## Deploying website via Rsync"
ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}") ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{rsync_args} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}")
end end
desc "deploy public directory to github pages" desc "deploy public directory to github pages"