Site44.com deploy task for Octopress
By Simon HarrisFurther to my previous post, I also added a rake task to my Rakefile that uses rsync to deploy:
rsync_delete = false
deploy_default = "local"
# snip
desc "Deploy website via local rsync"
task :local do
exclude = ""
if File.exists?('./rsync-exclude')
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
end
puts "## Deploying website via local rsync"
ok_failed system("rsync -avz #{exclude} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{deploy_dir}")
end
I initally thought it would be pretty neat to work out the local website location in Dropbox but in the end I decided it was simpler to just leave the deploy_dir variable set to the default "_deploy" and have that directory symlinked to the approproprate Dropbox folder.