Platinum Partner

Capistrano : Apply Local Patches When Deploying From An External Source Code Repository

I've submitted patches to a couple rails apps, and want to run off of their SCM's trunk code, but with my local patches applied. These Capistrano tasks will take any files matching 
in your local directory, and apply them before restarting your app. task :after_setup do patches_setup end task :after_update_code do send_and_apply_patches end task :patches_setup do run "mkdir -p #{deploy_to}/#{shared_dir}/patches" end task :send_and_apply_patches do Dir[File.join(File.dirname(__FILE__), '../patches/*.diff')].sort.each do |patch| puts "sending #{File.basename(patch)}" put(, "#{deploy_to}/#{shared_dir}/patches/#{File.basename(patch)}", :mode => 0777) puts "applying #{File.basename(patch)}" run "cd #{release_path}; patch -p0 < #{deploy_to}/#{shared_dir}/patches/#{File.basename(patch)}" end end
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ }}
{{ parent.authors[0].realName ||}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks