SVN revision from shell
echo "Subject: [rake deploy] Deployed revision `cd /home/www/current ; svn info | grep Revision | sed "s/Revision: //"` on `hostname` at `date`" > ~/sendmail_tmp
12390 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
echo "Subject: [rake deploy] Deployed revision `cd /home/www/current ; svn info | grep Revision | sed "s/Revision: //"` on `hostname` at `date`" > ~/sendmail_tmp
desc "remotely console" task :console, :roles => :app do input = '' run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data| next if data.chomp == input.chomp || data.chomp == '' print data channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/ end end
desc "tail production log files" task :tail_logs, :roles => :app do run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| puts # for an extra line break before the host name puts "#{channel[:host]}: #{data}" break if stream == :err end end
desc "List the files that would be updated or changed in a deploy." task :svn_st_up, :roles => :app do run "cd #{current_path} && " + "svn st -u" end
desc <<-DESC Spinner is run by the default cold_deploy task. Instead of using script/spinner, we're just gonna rely on Mongrel to keep itself up. DESC task :spinner, :roles => :app do application_port = xxxx #get this from your friendly sysadmin run "mongrel_rails start -e production -p #{application_port} -d -c #{current_path}" end
desc "Restart the web server" task :restart, :roles => :app do begin run "cd #{current_path} && mongrel_rails restart" rescue RuntimeError => e puts e puts "Probably not a big deal, so I'll just keep trucking..." end end