[英]Capistrano - with “:keep_releases” the deployment doesn't pass
I wanted to keep on the server only recent 5 releases, so I added following to the deploy/production.rb
file: 我只想保留服务器上最近的5个发行版,因此我将以下内容添加到deploy/production.rb
文件中:
set :keep_releases, 5
after "deploy:update", "deploy:cleanup"
But the problem is that when I run cap production deploy
, the deployment runs well until this point: 但是问题在于,当我运行cap production deploy
,该部署在此之前运行良好:
** transaction: commit
triggering after callbacks for `deploy:update'
* 2015-01-20 14:12:47 executing `deploy:cleanup'
* executing "sudo -p 'sudo password: ' ls -1dt /home/deployer/apps/appname/releases/* | tail -n +6 | sudo -p 'sudo password: ' xargs rm -rf"
servers: ["IP"]
[IP] executing command
** [out :: IP]
and here the deployment stuck - I've been waiting for an hour, maybe something over an hour, but nothing changed - the deployment hasn't finished. 部署就此停滞了-我已经等了一个小时,也许是一个多小时,但是什么都没改变-部署还没有完成。
Do I miss something? 我想念什么吗? Without those two lines in config the deployment takes just like a minute. 如果在配置中没有这两行,则部署过程将花费一分钟。
What's wrong here? 怎么了 I am using Rails 4 and Capistrano 2. 我正在使用Rails 4和Capistrano 2。
Thank you! 谢谢!
As far as I know, you need to specify :keep_releases in deploy.rb, instead of production.rb 据我所知,您需要在deploy.rb中指定:keep_releases,而不是production.rb
And default number of releases is 5. 且默认发行数量为5。
My deploy.rb 我的deploy.rb
# Default value for keep_releases is 5
# set :keep_releases, 5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.