When I run cap deploy
, Capistrano will attempt to create a folder such as $HOME/sites/MY_APP/releases/TIMESTAMP
. I can see the command attempting to run, but it will not actually create the folder.
I can copy the command directly out of the Capistrano output and run the command over SSH and it works great with no problems.
The command looks something so:
cp -RPp /home/some_user/sites/my_cool_app/shared/cached-copy /home/some_user/sites/my_cool_app/releases/20111123164239 && (echo 59bf115868c2430cd0475ca1596998f1cfa3c084 > /home/some_user/sites/my_cool_app/releases/20111123164239/REVISION)
Why would the command fail through Capistrano, but succeed through an SSH terminal?
I'm still not sure where the problem spans from but removing the line:
set :deploy_via, :remote_cache
Solved things for me. It looks like a bug where the releases directory isn't being created and so removing that line skips that step. A better approach if you want to keep the remote_cache is probably to add another step to setup like so:
after "deploy:setup", "deploy:create_release_dir"
namespace :deploy do
task :create_release_dir, :except => {:no_release => true} do
run "mkdir -p #{fetch :releases_path}"
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With