Sha256: 130076bbcc99ae66f921dd7f48ea981548d76479dbcfcb6efeac93d57e7aa350

Contents?: true

Size: 1.98 KB

Versions: 128

Compression:

Stored size: 1.98 KB

Contents

# Copyright 2006-2008 by Mike Bailey. All rights reserved.
Capistrano::Configuration.instance(:must_exist).load do 
  namespace :deprec do
    namespace :ar_sendmail do
      
      desc "Install ar_mailer"
      task :install, :roles => :app do
        gem2.install 'ar_mailer'
      end

      # install dependencies for ar_sendmail
      task :install_deps, :roles => :app do
        #pass
      end
      
      PROJECT_CONFIG_FILES[:ar_sendmail] = [
        
        {:template => 'monit.conf.erb',
         :path => "monit.conf", 
         :mode => 0600,
         :owner => 'root:root'},
         
        {:template => 'logrotate.conf.erb',
         :path => "logrotate.conf", 
         :mode => 0644,
         :owner => 'root:root'}
      ]
       
      task :config_gen do
        config_gen_project
      end
      
      desc "Generate configuration file(s) for ar_sendmail from template(s)"
      task :config_gen_project do
        PROJECT_CONFIG_FILES[:ar_sendmail].each do |file|
          deprec2.render_template(:ar_sendmail, file)
        end
      end
      
      desc "Push ar_sendmail config files to server"
      task :config, :roles => :app do
        config_project
      end
      
      task :config_project, :roles => :app do
        deprec2.push_configs(:ar_sendmail, PROJECT_CONFIG_FILES[:ar_sendmail])
        symlink_monit_config
        symlink_logrotate_config
      end
      
      task :symlink_monit_config, :roles => :app do
        deprec2.mkdir(monit_confd_dir, :via => :sudo)
        sudo "ln -sf #{deploy_to}/ar_sendmail/monit.conf #{monit_confd_dir}/ar_sendmail_#{application}.conf"
      end
      
      task :unlink_monit_config, :roles => :app do
        link = "#{monit_confd_dir}/ar_sendmail_#{application}.conf"
        sudo "test -L #{link} && unlink #{link}"
      end
      
      task :symlink_logrotate_config, :roles => :app do
        sudo "ln -sf #{deploy_to}/ar_sendmail/logrotate.conf /etc/logrotate.d/ar_sendmail-#{application}"
      end
    
    end
  end
end

Version data entries

128 entries across 128 versions & 5 rubygems

Version Path
andyh-deprec-1.99.27 lib/deprec/recipes/ar_sendmail.rb
isaac-deprec-1.99.30 lib/deprec/recipes/ar_sendmail.rb
isaac-deprec-1.99.32 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.088 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.087 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.086 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.085 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.084 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.083 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.082 lib/deprec/recipes/ar_sendmail.rb
deprec-2.2.3 lib/deprec/recipes/ar_sendmail.rb
deprec-2.2.2 lib/deprec/recipes/ar_sendmail.rb
deprec-2.2.1 lib/deprec/recipes/ar_sendmail.rb
deprec-2.2.0 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.081 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.080 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.079 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.078 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.077 lib/deprec/recipes/ar_sendmail.rb
le1t0-deprec-2.1.6.076 lib/deprec/recipes/ar_sendmail.rb