diff --git a/CHANGELOG b/CHANGELOG index fc2acaa0..a06b28cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Make sure all directories exist on each deploy which are necessary for subsequent commands to succeed, since some SCM's won't save empty directories [Matthew Elder] + * Add :default_environment variable, which is applied to every command diff --git a/lib/capistrano/recipes/deploy.rb b/lib/capistrano/recipes/deploy.rb index fc94f6e0..11542ac5 100644 --- a/lib/capistrano/recipes/deploy.rb +++ b/lib/capistrano/recipes/deploy.rb @@ -147,8 +147,12 @@ namespace :deploy do task :finalize_update, :except => { :no_release => true } do run "chmod -R g+w #{release_path}" if fetch(:group_writable, true) + # mkdir -p is making sure that the directories are there for some SCM's that don't + # save empty folders run <<-CMD rm -rf #{release_path}/log #{release_path}/public/system #{release_path}/tmp/pids && + mkdir -p #{release_path}/public && + mkdir -p #{release_path}/tmp && ln -s #{shared_path}/log #{release_path}/log && ln -s #{shared_path}/system #{release_path}/public/system && ln -s #{shared_path}/pids #{release_path}/tmp/pids