Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smith/189032 to your computer and use it in GitHub Desktop.
Save smith/189032 to your computer and use it in GitHub Desktop.
# Helper to execute blocks of shell commands via capistrano run
def run_chunk(cmd,options={})
run cmd.split("\n").map {|l| l.strip }.join(" "), options
end
# Example
task :revision, :roles => [:app] do
run_chunk %Q{
rm -f #{current_release}/public/REVISION;cp #{current_release}/REVISION #{current_release}/public/REVISION;
cd #{current_release}; git config --list | grep branch\.deploy >> #{current_release}/public/REVISION;
cd #{current_release}; git --no-pager log --stat --no-merges --no-color master.. >> #{current_release}/public/REVISION;
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment