Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano and deployment of a website from Github

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.

like image 601
Trevor Burnham Avatar asked Jun 11 '10 15:06

Trevor Burnham


1 Answers

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

like image 81
David Avatar answered Oct 12 '22 07:10

David