我正在使用 Capistrano v2.13.4 进行部署。
之前的 Capistrano 任务 ( deploy:special_treats
)deploy:finalize_update
未执行。
该任务deploy:special_treats
为 做一些准备(设置互联网访问)bundle:install
,否则bundle:install
将无法访问互联网 ([out :: servername] Could not reach https://rubygems.org/
在config/deploy.rb
before 'deploy:finalize_update', 'deploy:special_treats'
和
namespace :deploy do
task :special_treats do
run "echo 'something special treats: setup the Internet access'"
end
end
结果为cap deploy:update
$ cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "svn info https://svnlinks --username username --password password --no-auth-cache -rHEAD"
command finished in 10336ms
* getting (via export) revision 33268 to /tmp/20120927171608
executing locally: svn export -q --username username --password password --no-auth-cache -r33268 https://svnlinks /tmp/20120927171608
command finished in 79314ms
* processing exclusions...
* Compressing /tmp/20120927171608 to /tmp/20120927171608.tar.gz
executing locally: tar czf 20120927171608.tar.gz 20120927171608
command finished in 1401ms
servers: ["servername"]
** sftp upload /tmp/20120927171608.tar.gz -> /tmp/20120927171608.tar.gz
[servername] /tmp/20120927171608.tar.gz
[servername] done
* sftp upload complete
* executing "cd /usr/website/rr/releases && tar xzf /tmp/20120927171608.tar.gz && rm /tmp/20120927171608.tar.gz"
servers: ["servername"]
[servername] executing command
command finished in 774ms
* executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* executing `bundle:install'
* executing "cd /usr/website/rr/releases/20120927171608 && bundle install --gemfile /usr/website/rr/releases/20120927171608/Gemfile --path /usr/website/rr/shared/bundle --deployment --quiet --without development
test"
servers: ["servername"]
[servername] executing command
** [out :: servername] Could not reach https://rubygems.org/
command finished in 1403ms
*** [deploy:update_code] rolling back
* executing "rm -rf /usr/website/rr/releases/20120927171608; true"
servers: ["servername"]
[servername] executing command
command finished in 344ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3-p194' -c 'cd /usr/website/rr/releases/20120927171608 && bundle install --gemfile /usr/website/rr/releases/20120927171608/Gemfile --path
/usr/website/rr/shared/bundle --deployment --quiet --without development test'" on servername