Sha256: bf895e4c87c2d2e473058fe237e625f720eb5d1a3a63e79c52798d0b4071a682

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

#
# Cookbook Name:: sidekiq
# Recipe:: default
#
if ['solo', 'util'].include?(node[:instance_role])

  # for now
  worker_count = 1

  node[:applications].each do |app, data|
    template "/etc/monit.d/sidekiq_#{app}.monitrc" do 
      owner 'root' 
      group 'root' 
      mode 0644 
      source "monitrc.conf.erb" 
      variables({ 
        :num_workers => worker_count,
        :app_name => app, 
        :rails_env => node[:environment][:framework_env] 
      }) 
    end

    template "/engineyard/bin/sidekiq" do
      owner 'root'
      group 'root' 
      mode 0755
      source "sidekiq.erb" 
    end

    worker_count.times do |count|
      template "/data/#{app}/shared/config/sidekiq_#{count}.yml" do
        owner node[:owner_name]
        group node[:owner_name]
        mode 0644
        source "sidekiq.yml.erb"
        variables({
          :require => "/data/#{app}/current"
        })
      end
    end

    execute "ensure-sidekiq-is-setup-with-monit" do 
      command %Q{ 
        monit reload 
      } 
    end

    execute "restart-sidekiq" do 
      command %Q{ 
        echo "sleep 20 && monit -g #{app}_sidekiq restart all" | at now 
      }
    end
  end 
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidekiq-0.9.1 examples/chef/cookbooks/sidekiq/recipes/default.rb
sidekiq-0.9.0 examples/chef/cookbooks/sidekiq/recipes/default.rb
sidekiq-0.8.0 examples/chef/cookbooks/sidekiq/recipes/default.rb
sidekiq-0.7.0 examples/chef/cookbooks/sidekiq/recipes/default.rb