Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Created October 30, 2010 01:00
Show Gist options
  • Select an option

  • Save technicalpickles/654745 to your computer and use it in GitHub Desktop.

Select an option

Save technicalpickles/654745 to your computer and use it in GitHub Desktop.
capistrano trix to upload `git diff --staged` and `git apply` that, instead of using `:scm: none` with `:deploy_via: copy`
after 'deploy:update_code' do
system("mkdir -p tmp && git diff --staged > #{rails_root}/tmp/staged.diff")
put File.read("#{rails_root}/tmp/staged.diff"), '/tmp/staged.diff'
run "cd #{latest_release} && if test -s /tmp/staged.diff; then git apply /tmp/staged.diff; fi"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment