Permalink
Browse files

Minor bugfixes, resolves #19

  • Loading branch information...
ajgon committed Apr 24, 2016
1 parent 3ecb321 commit 9f8615f70bb3e0fc35e261de64bd232db99cabd3
Showing with 61 additions and 60 deletions.
  1. +1 −0 README.md
  2. +1 −1 metadata.rb
  3. +59 −59 spec/unit/recipes/configure_spec.rb
View
@@ -36,6 +36,7 @@ to do is create a layer and application with assigned RDS data source, then
### Cookbooks
* [build-essential (~> 2.0)](https://supermarket.chef.io/cookbooks/build-essential/versions/2.4.0)
* [deployer](https://supermarket.chef.io/cookbooks/deployer)
* [ruby-ng](https://supermarket.chef.io/cookbooks/ruby-ng)
* [nginx (~> 2.7)](https://supermarket.chef.io/cookbooks/nginx)
View
@@ -5,7 +5,7 @@
license 'MIT'
description 'Set of chef recipes for OpsWorks based Ruby projects'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
version '0.2.0'
depends 'build-essential', '~> 2.0'
depends 'deployer'
@@ -155,67 +155,67 @@
.to render_file("/etc/nginx/ssl/#{aws_opsworks_app['domains'].first}.dhparams.pem")
.with_content('--- DH PARAMS ---')
end
end
it 'creates sidekiq.conf.yml' do
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/config/sidekiq_1.yml")
.with_content("---\nconcurency: 5\nverbose: false\nqueues:\n- default")
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/config/sidekiq_2.yml")
.with_content("---\nconcurency: 5\nverbose: false\nqueues:\n- default")
end
it 'creates sidekiq.conf.yml' do
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/config/sidekiq_1.yml")
.with_content("---\nconcurency: 5\nverbose: false\nqueues:\n- default")
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/config/sidekiq_2.yml")
.with_content("---\nconcurency: 5\nverbose: false\nqueues:\n- default")
end
it 'creates sidekiq.monitrc conf' do
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('check process sidekiq_dummy_project-1')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('with pidfile /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'start program = "/bin/su - deploy -c \'cd /srv/www/dummy_project/current && ENV_VAR1="test" ' \
'ENV_VAR2="some data" RAILS_ENV="production" bundle exec sidekiq ' \
'-C /srv/www/dummy_project/shared/config/sidekiq_1.yml ' \
'-P /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid ' \
'-r /srv/www/dummy_project/current/lorem_ipsum.rb 2>&1 ' \
'| logger -t sidekiq-dummy_project-1\'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'stop program = "/bin/su - deploy -c ' \
'\'kill -s TERM `cat /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid`\'' \
'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('check process sidekiq_dummy_project-2')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('with pidfile /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'start program = "/bin/su - deploy -c \'cd /srv/www/dummy_project/current && ENV_VAR1="test" ' \
'ENV_VAR2="some data" RAILS_ENV="production" bundle exec sidekiq ' \
'-C /srv/www/dummy_project/shared/config/sidekiq_2.yml ' \
'-P /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid ' \
'-r /srv/www/dummy_project/current/lorem_ipsum.rb 2>&1 ' \
'| logger -t sidekiq-dummy_project-2\'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'stop program = "/bin/su - deploy -c ' \
'\'kill -s TERM `cat /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid`\'' \
'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('group sidekiq_dummy_project_group')
it 'creates sidekiq.monitrc conf' do
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('check process sidekiq_dummy_project-1')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('with pidfile /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'start program = "/bin/su - deploy -c \'cd /srv/www/dummy_project/current && ENV_VAR1="test" ' \
'ENV_VAR2="some data" RAILS_ENV="production" bundle exec sidekiq ' \
'-C /srv/www/dummy_project/shared/config/sidekiq_1.yml ' \
'-P /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid ' \
'-r /srv/www/dummy_project/current/lorem_ipsum.rb 2>&1 ' \
'| logger -t sidekiq-dummy_project-1\'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'stop program = "/bin/su - deploy -c ' \
'\'kill -s TERM `cat /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-1.pid`\'' \
'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('check process sidekiq_dummy_project-2')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('with pidfile /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid')
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'start program = "/bin/su - deploy -c \'cd /srv/www/dummy_project/current && ENV_VAR1="test" ' \
'ENV_VAR2="some data" RAILS_ENV="production" bundle exec sidekiq ' \
'-C /srv/www/dummy_project/shared/config/sidekiq_2.yml ' \
'-P /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid ' \
'-r /srv/www/dummy_project/current/lorem_ipsum.rb 2>&1 ' \
'| logger -t sidekiq-dummy_project-2\'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content(
'stop program = "/bin/su - deploy -c ' \
'\'kill -s TERM `cat /srv/www/dummy_project/shared/pids/sidekiq_dummy_project-2.pid`\'' \
'" with timeout 90 seconds'
)
expect(chef_run)
.to render_file("/etc/monit/conf.d/sidekiq_#{aws_opsworks_app['shortname']}.monitrc")
.with_content('group sidekiq_dummy_project_group')
end
end
context 'Mysql' do

0 comments on commit 9f8615f

Please sign in to comment.