Files
grecia/lib/capistrano/tasks/restart.cap
Juan Salvador Pérez García 1db5a00eae Prepare capistrano/db migrations to support more setups (#2)
The following parameters have been added to deploy-secrets.yml:

* **use_rvm**: yes/no
* **ruby_version**: Ruby version for rvm. Defaults to 2.3.2
* **repository**: Git repository. Defaults to the oficial repository
* **branch**: Branch to deploy. Defaults to master
* **rails_env**: Defaults to the stage.

Fixed migrations that required admin rights. Now first check if the postgress extensions are available. If so finish without doing nothin.

Added support for passenger.
2018-07-17 17:46:54 +02:00

20 lines
616 B
Plaintext

namespace :deploy do
desc 'Commands for passenger/unicorn application'
if File.exist?("/etc/init.d/unicorn_#{fetch(:full_app_name)}")
%w(start stop force-stop restart upgrade reopen-logs).each do |command|
task command.to_sym do
on roles(:app), in: :sequence, wait: 5 do
execute "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}"
end
end
end
else
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
end
end