V
V
vadimstroganov2015-05-03 15:05:15
Ruby on Rails
vadimstroganov, 2015-05-03 15:05:15

How not to restart the server every time for Rails + Capistrano?

Hello!
I just started to deal with the deployment of my application on VPS
I configured nginx + passenger on the server
After the cap production deploy command , all changes go to the server, but in order for them to take effect, I have to restart the VPS manually every time.
How can I make it so that I do not manually restart the VPS?
My deploy.rb config:

# config valid only for Capistrano 3.1
lock '3.1.0'

set :application, 'Project name'
set :repo_url, 'repo'
set :git_http_username, 'login'
set :git_http_password, 'pass'

# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/var/www/Project name'

# Default value for :linked_files is []
set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do

  desc 'Restart application'
  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

  after :publishing, :restart

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end
    end
  end

end

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay, 2015-07-20
@metallurg_it

Can you share the setup guide?
And then I RoR Deploy (ANSIBLE + CAPISTRANO) config (need FIX)? stuck, maybe you have a solution to my troubles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question