Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cap deploy doesn't create share/log folder

When I run my cap deploy, it complains that it can't access the log file:

Rails Error: Unable to access log file. Please ensure that /var/superduperapp/releases/20120329011558/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

It seems that I have to manually create a log folder. Is there a way to do this with Capistrano so whoever is deploying it doesn't have to remember to create the folder each time they do a new deploy?

like image 367
dnatoli Avatar asked Mar 29 '12 07:03

dnatoli


2 Answers

These folders should be created by capistrano when you run cap deploy:setup, have you ran it? To check if everything is fine you can run cap deploy:check before it.

like image 177
Aldo 'xoen' Giambelluca Avatar answered Oct 27 '22 05:10

Aldo 'xoen' Giambelluca


You can create a custom task to create this directory and launch it as the first task:

task :create_log_share do
  run "mkdir -p #{shared_path}/log"
end
before 'deploy:update', :create_log_share

This directory does not need to be created each the time when you deploy. Once is enough. The shared directory never changes.

like image 33
shingara Avatar answered Oct 27 '22 05:10

shingara