From c39657cf5c9b0336e9bbfb4771a9147722ed37c0 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 21 Aug 2015 17:06:35 +0200 Subject: [PATCH] fixes capistrano unicorn restart task --- config/deploy.rb | 3 +++ lib/capistrano/tasks/restart.cap | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 9c45bd283..200561451 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -6,11 +6,14 @@ def deploysecret(key) @deploy_secrets_yml[key.to_s] end + set :rails_env, fetch(:stage) set :rvm_ruby_version, '2.2.2' set :rvm_type, :user set :application, 'participacion' +set :full_app_name, deploysecret(:full_app_name) + set :server_name, deploysecret(:server_name) #set :repo_url, 'git@github.com:AyuntamientoMadrid/participacion.git' # If ssh access is restricted, probably you need to use https access diff --git a/lib/capistrano/tasks/restart.cap b/lib/capistrano/tasks/restart.cap index ff8c028f0..54c90819a 100644 --- a/lib/capistrano/tasks/restart.cap +++ b/lib/capistrano/tasks/restart.cap @@ -3,7 +3,7 @@ namespace :deploy do %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 - sudo "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}" + execute "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}" end end end