Skip to content

Commit

Permalink
v2.0.0: Release ready for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Jan 28, 2018
1 parent 9141c4d commit de2edf0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/capistrano/php_fpm/systemd.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
load File.expand_path('../../php_fpm.rake.rake', __FILE__) # Load configuration options
load File.expand_path('../tasks/php_fpm.rake.rake', __FILE__)
load File.expand_path('../php_fpm.rake', __FILE__) # Load configuration options
load File.expand_path('../tasks/php_fpm.rake', __FILE__)
4 changes: 2 additions & 2 deletions lib/capistrano/php_fpm/sysv_upstart.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
load File.expand_path('../../php-fpm.rake', __FILE__) # Load configuration options
load File.expand_path('../tasks/sysv_upstart.rake.rake', __FILE__)
load File.expand_path('../php-fpm.rake', __FILE__) # Load configuration options
load File.expand_path('../tasks/sysv_upstart.rake', __FILE__)
12 changes: 5 additions & 7 deletions lib/capistrano/php_fpm/tasks/systemd.rake
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
service_name = fetch(:php_fpm_service_name)
systemctl_location = fetch(:systemctl_location_name)
namespace :'php_fpm' do
desc 'Reload php_fpm'
task :reload do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, systemctl_location, "reload #{service_name}.service") : execute(systemctl_location, "reload #{service_name}.service")
fetch(:php_fpm_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "reload #{fetch(:php_fpm_service_name)}.service") : execute(fetch(:systemctl_location), "reload #{fetch(:php_fpm_service_name)}.service")
end
end

desc 'Zap php_fpm'
task :zap do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, systemctl_location, "zap #{service_name}.service") : execute(systemctl_location, "zap #{service_name}.service")
fetch(:php_fpm_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "zap #{fetch(:php_fpm_service_name)}.service") : execute(fetch(:systemctl_location), "zap #{fetch(:php_fpm_service_name)}.service")
end
end

desc 'Stop php_fpm'
task :stop do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, systemctl_location, "stop #{service_name}.service") : execute(systemctl_location, "stop #{service_name}.service")
fetch(:php_fpm_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "stop #{fetch(:php_fpm_service_name)}.service") : execute(fetch(:systemctl_location), "stop #{fetch(:php_fpm_service_name)}.service")
end
end

desc 'Start php_fpm'
task :start do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, systemctl_location, "start #{service_name}.service") : execute(systemctl_location, "start #{service_name}.service")
fetch(:php_fpm_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "start #{fetch(:php_fpm_service_name)}.service") : execute(fetch(:systemctl_location), "start #{fetch(:php_fpm_service_name)}.service")
end
end

desc 'Restart php_fpm'
task :restart do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, systemctl_location, "restart #{service_name}.service") : execute(systemctl_location, "restart #{service_name}.service")
fetch(:php_fpm_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "restart #{fetch(:php_fpm_service_name)}.service") : execute(fetch(:systemctl_location), "restart #{fetch(:php_fpm_service_name)}.service")
end
end
end
Expand Down
11 changes: 5 additions & 6 deletions lib/capistrano/php_fpm/tasks/sysv_upstart.rake
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
command = "/etc/init.d/#{fetch(:php_fpm_service_name)}"
namespace :'php_fpm' do
desc 'Reload php_fpm'
task :reload do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, command, 'reload') : execute(command, 'reload')
fetch(:php_fpm_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:php_fpm_service_name)}", 'reload') : execute("/etc/init.d/#{fetch(:php_fpm_service_name)}", 'reload')
end
end

desc 'Zap php_fpm'
task :zap do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, command, 'zap') : execute(command, 'zap')
fetch(:php_fpm_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:php_fpm_service_name)}", 'zap') : execute("/etc/init.d/#{fetch(:php_fpm_service_name)}", 'zap')
end
end

desc 'Stop php_fpm'
task :stop do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, command, 'stop') : execute(command, 'stop')
fetch(:php_fpm_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:php_fpm_service_name)}", 'stop') : execute("/etc/init.d/#{fetch(:php_fpm_service_name)}", 'stop')
end
end

desc 'Start php_fpm'
task :start do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, command, 'start') : execute(command, 'start')
fetch(:php_fpm_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:php_fpm_service_name)}", 'start') : execute("/etc/init.d/#{fetch(:php_fpm_service_name)}", 'start')
end
end

desc 'Restart php_fpm'
task :restart do
on release_roles(fetch(:php_fpm_roles)) do
fetch(:php_fpm_with_sudo) ? execute(:sudo, command, 'restart') : execute(command, 'restart')
fetch(:php_fpm_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:php_fpm_service_name)}", 'restart') : execute("/etc/init.d/#{fetch(:php_fpm_service_name)}", 'restart')
end
end
end

0 comments on commit de2edf0

Please sign in to comment.