Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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