Capistrano and deployment of a website from Github

坚强是说给别人听的谎言 提交于 2019-12-06 19:43:37

问题


So, I had what I thought was a fairly simple Capistrano use case: I want to deploy a PHP site from Github. But I'm running into a lot of problems. When I run cap deploy, Capistrano is able to clone the Github repo (the deploy:update_code step), but then in the deploy:finalize_update step it says

executing "rm -rf /var/www/sitename.com/releases/20100611144519/log /var/www/sitename.com/releases/20100611144519/public/system /var/www/sitename.com/releases/20100611144519/tmp/pids &&\\\n      mkdir -p /var/www/sitename.com/releases/20100611144519/public &&\\\n      mkdir -p /var/www/sitename.com/releases/20100611144519/tmp &&\\\n      ln -s /var/www/sitename.com/shared/log /var/www/sitename.com/releases/20100611144519/log &&\\\n      ln -s /var/www/sitename.com/shared/system /var/www/sitename.com/releases/20100611144519/public/system &&\\\n      ln -s /var/www/sitename.com/shared/pids /var/www/sitename.com/releases/20100611144519/tmp/pids"

followed by

executing "find /var/www/sitename.com/releases/20100611144519/public/images /var/www/sitename.com/releases/20100611144519/public/stylesheets /var/www/sitename.com/releases/20100611144519/public/javascripts -exec touch -t 201006111445.23 {} ';'; true"

I don't really understand what's going on here. It then gives an error:

*** [err :: sitename.com] find: `/var/www/sitename.com/releases/20100611144519/public/images': No such file or directory

and another error for each of the stylesheets and javascripts directories.

What's going on? I realize that Capistrano is primarily for deploying Rails and other Ruby apps, but I'm using the capistrano-php gem. I'd appreciate any help.


回答1:


Capistrano default behavior is to 'touch' all assets files. (To make sure that any cache get the deployment date). Assets are images, stylesheets, etc.

If your PHP application is not using these directories, capistrano complains in such an ugly way.

To disable asset timestamps updates, simply add:

 set :normalize_asset_timestamps, false

to your deploy.rb



来源:https://stackoverflow.com/questions/3023857/capistrano-and-deployment-of-a-website-from-github

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!