简体   繁体   中英

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:

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:

 ** 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.

Thank you!

As far as I know, you need to specify :keep_releases in deploy.rb, instead of production.rb

And default number of releases is 5.

My deploy.rb

# Default value for keep_releases is 5
# set :keep_releases, 5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM