Forked from donnoman/Capistrano runing chunks of shell commands.rb
Created
September 18, 2009 12:33
-
-
Save smith/189032 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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