Skip to content

Instantly share code, notes, and snippets.

@donnoman
Created September 17, 2009 23:23
Show Gist options
  • Save donnoman/188784 to your computer and use it in GitHub Desktop.
Save donnoman/188784 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{
cd #{current_release};
cp REVISION public/REVISION;
git config --list | grep branch\.deploy >> public/REVISION;
git --no-pager log --stat --no-merges --no-color master.. >> public/REVISION;
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment