Forum: Ruby on Rails Capistrano - 'sanity_check' task

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
blinking bear (Guest)
on 2007-07-26 21:25
(Received via mailing list)
I instantly refresh my browser after deploying to make sure nothing went
wrong.  This gets tiring so I added some code to hit the site and print
results after the deployment task has been run.  The Net:HTTP code is
verbatim from the pickaxe Net:HTTP reference.

task :after_deploy, :roles => :app do

desc "Use Net:HTTP to pull up the live site"
task :sanity_check do
  Net::HTTP.start('') do |http|
    response = http.get('/')
    puts "Code = #{response.code}"
    puts "Message = #{response.message}"
    response.each do |key,val|
      printf "%-14s = %-40.40s\n", key, val
    p response.body[400,500]
This topic is locked and can not be replied to.