From ef0c790bd566e712d0ae4d93822b6dbd4ec4f52c Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 1 Jun 2007 03:04:20 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6918 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- CHANGELOG | 2 ++ lib/capistrano/recipes/deploy.rb | 4 ++++ 2 files changed, 6 insertions(+) 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