Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix: Switched from nginx reload to nginx restart after succesful …
Browse files Browse the repository at this point in the history
…deploy/undeploy

Nginx needs to be restarted, otherwise it won't load some config changes (for example updated SSL
certificates).

Resolves #36
  • Loading branch information
Igor Rzegocki committed Sep 2, 2016
1 parent c1d4a76 commit 16ab9d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libraries/drivers_webserver_nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Nginx < Drivers::Webserver::Base
:log_dir, :proxy_read_timeout, :proxy_send_timeout, :send_timeout, :ssl_for_legacy_browsers,
:extra_config, :extra_config_ssl
]
notifies :deploy, action: :reload, resource: 'service[nginx]', timer: :delayed
notifies :undeploy, action: :reload, resource: 'service[nginx]', timer: :delayed
notifies :deploy, action: :restart, resource: 'service[nginx]', timer: :delayed
notifies :undeploy, action: :restart, resource: 'service[nginx]', timer: :delayed

def raw_out
output = node['defaults']['webserver'].merge(node['nginx']).merge(
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

expect(chef_run).to run_execute('stop unicorn')
expect(chef_run).to run_execute('start unicorn')
expect(deploy).to notify('service[nginx]').to(:reload).delayed
expect(deploy).to notify('service[nginx]').to(:restart).delayed
expect(service).to do_nothing
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/undeploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
expect(chef_run).to run_execute('stop unicorn')
expect(chef_run).to run_execute('start unicorn')

expect(undeploy).to notify('service[nginx]').to(:reload).delayed
expect(undeploy).to notify('service[nginx]').to(:restart).delayed
expect(service).to do_nothing
end

Expand Down

0 comments on commit 16ab9d1

Please sign in to comment.