使用Capistrano推送托管在DigitalOcean服务器上的Ruby on Rails应用程序。之前的开发团队构建了部署配置,我尝试推送存储在GitHub存储库中的更新。
'上限生产部署'命令通过,但服务器上没有任何更改。命令行上的跟踪是一英里长,如果有帮助,我可以发布它。
这是我的deploy.rb文件:
require 'soprano'
require 'bundler/capistrano'
require 'capistrano/ext/multistage'
require 'whenever/capistrano'
require 'leipreachan/capistrano2'
set :default_environment, {
'PATH' => '/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH'
}
set :web_server, :nginx
set :keep_releases, 3
set :repository, 'git@github.com:mitigation/mpm.git'
set :deploy_via, :copy
set :copy_exclude, %w(.git .idea .yardoc tmp log .DS_Store doc/* public/uploads.tar db/*.sql vendor/cache)
set :copy_cache, true
set :bundle_without, [:development, :test]
set :bundle_flags, '--deployment --binstubs'
set :user, 'deploy'
before 'deploy:setup', :db
after 'deploy:create_symlink', 'utils:version'
after 'deploy:update_code', 'db:symlink'
#For troubleshooting only
namespace :deploy do
task :update_code, :except => { :no_release => true } do
#on_rollback { run "rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end
end
编辑2016年8月9日: 这是命令触发的尾端。它看起来不会引发错误,但服务器上没有任何内容发生变化。
2016-07-19 14:11:49 executing `deploy:create_symlink'
* executing "rm -f /var/www/apps/mpm/current && ln -s /var/www/apps/mpm/releases/20160719180333 /var/www/apps/mpm/current"
servers: ["104.131.68.111"]
[104.131.68.111] executing command
command finished in 99ms
triggering after callbacks for `deploy:create_symlink'
* 2016-07-19 14:11:49 executing `utils:version'
* executing "cd /var/www/apps/mpm/releases/20160719180333 && echo r1 > APP_VERSION"
servers: ["104.131.68.111"]
[104.131.68.111] executing command
command finished in 94ms
** transaction: commit
* 2016-07-19 14:11:49 executing `deploy:restart'
* executing "sudo service mpm restart"
servers: ["104.131.68.111"]
[104.131.68.111] executing command
** [out :: 104.131.68.111] mpm stop/waiting
** [out :: 104.131.68.111] mpm start/running, process 21131
command finished in 214ms