我已经设置了我的rails应用程序与rpush一起使用.它使用rpush start在开发中在本地工作正常.但是现在我想使用capistrano-2.15.5将它部署到我的EC2服务器上. 部署我的deploy.rb: after "deploy:stop",
部署我的deploy.rb:
after "deploy:stop", "delayed_job:stop" after "deploy:stop", "rpush:stop" after "deploy:start", "delayed_job:start" after "deploy:start", "rpush:start" after "deploy:restart", "delayed_job:restart" after "deploy:restart", "rpush:restart" namespace :rpush do %w[start stop restart].each do |command| desc "#{command} rpush deamon" task command, roles: :app, except: {no_release: true} do run "cd #{deploy_to}/current && bundle exec rpush #{command}" end end end
现在,问题
>它从开发环境开始.我试着理解this页面告诉我该怎么做,但我做不到.
>我不知道pid是否存储在/ current目录或/ shared目录中.它应该在共享中,以便文件在部署之间保持不变
如果有人这样做(即使以不同的方式),请告诉我如何.
或者,我如何修复我的cap配方和/ initializers / rpush
对于Capistrano 3:after :finished, :restart_rpush do on roles(:web) do within release_path do with rails_env: fetch(:rails_env) do execute :bundle, :exec, "rpush stop -e #{fetch(:rails_env)}" execute :bundle, :exec, "rpush start -e #{fetch(:rails_env)}" end end end end
然后检查tmp和其他目录是否正确链接:
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle publichttp://img.558idc.com/uploadfile}