2016-07-03 2 views
0

Capistrano를 설치했는데 Capistrano가 배치 후 승객을 다시 시작하지 않는 경우를 제외하고는 제대로 작동합니다. 배포 후 Eveytime 서버에 ssh를 입력하고 touch tmp/restart.txtcurrent directory 안에 입력해야합니다. 나는 승객을 다시 시작하는 다른 방법을 시도했지만 아무것도 나를 위해 일하고있다. 난 내 유사 문제와 유래에 코드 조각 위에서 발견 Capistrano가 nginx를 다시 시작하지 않음

namespace :deploy do 
    task :restart do 
    on roles(:app) do 
     within current_path do 
     execute :touch, 'tmp/restart.txt' 
     end 
    end 
    end 
end 

third attempt

namespace :deploy do 
    task :restart do 
    run "touch #{current_path}/tmp/restart.txt" 
    end 
end 

second attempt

namespace :deploy do 
    task :restart do 
    on roles(:app) do 
     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
    end 
end 

first attempt:

하지만 그들 중 누구도 서버를 다시 시작하지 않습니다.

나는 그것은 당신의 deploy:restart 작업이 실행되지 않는 것을 수 Rails 4 (의 nginx + 승객)

답변

1

capistrano (3.4.0)을 사용하고 있습니다.

카피스트라 3.1.0 이상 (Capistrano's CHANGELOG에서 설명)은 cap deploy의 끝에 자동으로 deploy:restart을 실행하지 않습니다.

당신은, 따라서 명시 적으로 deploy.rb이를 추가하여, 그렇게 카피 스트라 노 알려야합니다 :

after 'deploy:publishing', 'deploy:restart' 
+0

안녕 매트 나중에 내'배포 : restart'이 실행되지 않습니다. 나는 일을 마치고 당신의 제안을 시도 할 것이고, 당신을 저녁에 최신 상태로 유지할 것이다. 감사합니다 – Reboot

+0

큰 일을했습니다. 감사. – Reboot

관련 문제