ruby-on-rails – 使用capistrano在生产中运行rpush作为守护进程
发布时间:2020-12-17 01:34:41 所属栏目:百科 来源:网络整理
导读:我已经设置了我的rails应用程序与rpush一起使用.它使用rpush start在开发中在本地工作正常.但是现在我想使用capistrano-2.15.5将它部署到我的EC2服务器上. 部署我的deploy.rb: after "deploy:stop","delayed_job:stop"after "deploy:stop","rpush:stop"afte
我已经设置了我的rails应用程序与rpush一起使用.它使用rpush start在开发中在本地工作正常.但是现在我想使用capistrano-2.15.5将它部署到我的EC2服务器上.
部署我的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页面告诉我该怎么做,但我做不到. 如果有人这样做(即使以不同的方式),请告诉我如何. 或者,我如何修复我的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,"rpush start -e #{fetch(:rails_env)}" end end end end 然后检查tmp和其他目录是否正确链接: set :linked_dirs,%w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/uploads} (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |