Sha256: d3487dd70e5251a97d6194a69048464d53b205bff09869fc53939da6df64464d

Contents?: true

Size: 1.88 KB

Versions: 20

Compression:

Stored size: 1.88 KB

Contents

Capistrano::Configuration.instance(:must_exist).load do
  
  namespace :slice do
    
    desc "Tail the Rails log for this environment"
    task :tail_logs, :roles => :app do
      run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data|
        puts # for an extra line break before the host name
        puts "#{channel[:server]} -> #{data}"
        break if stream == :err
      end
    end
    
    desc "Tail the system log for this environment"
    task :tail_syslog, :roles => :app do
      sudo "tail -f /var/log/syslog" do |channel, stream, data|
        puts # for an extra line break before the host name
        puts "#{channel[:server]} -> #{data}"
        break if stream == :err
      end
    end
    
    desc "Tail the message log for this environment"
    task :tail_messages, :roles => :app do
      sudo "tail -f /var/log/messages" do |channel, stream, data|
        puts # for an extra line break before the host name
        puts "#{channel[:server]} -> #{data}"
        break if stream == :err
      end
    end
    
    desc <<-DESC
    grep the production.log to find long running queries
    DESC
    task :grep_requests, :roles => :app do
      run "grep 'Completed in [0-9]*' #{shared_path}/log/#{rails_env}.log"
    end

    desc <<-DESC
    grep the production.log to find long running queries
    DESC
    task :grep_long_requests, :roles => :app do
      run "grep 'Completed in [0-9][0-9]' #{shared_path}/log/#{rails_env}.log"
    end
    
  end
  
  # Deploy the custom maintenance page
  define_recipe :custom_maintenance_page do
    
    desc "Copy the maintenance page from the public directory to the shared directory"
    task :copy_maintenance_page, :roles => :app do
      upload "public/maintenance.html","#{shared_path}/system/maintenance.html.custom", :via => :scp
    end
    
    before "deploy:web:disable",      "slice:copy_maintenance_page"
  end
  
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
factorylabs-fdlcap-0.3.19 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.20 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.21 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.23 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.24 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.25 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.26 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.27 lib/fdlcap/recipes/slice.rb
factorylabs-fdlcap-0.3.28 lib/fdlcap/recipes/slice.rb
fdlcap-0.4.4 lib/fdlcap/recipes/slice.rb
fdlcap-0.4.3 lib/fdlcap/recipes/slice.rb
fdlcap-0.4.2 lib/fdlcap/recipes/slice.rb
fdlcap-0.4.0 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.35 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.34 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.33 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.31 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.30 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.29 lib/fdlcap/recipes/slice.rb
fdlcap-0.3.28 lib/fdlcap/recipes/slice.rb