=========================================
set :application, "corpsite"
set :repository, "https://staging/site/trunk"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
# set :deploy_to, "/var/www/#{application}"
# If you aren't using Subversion to manage your source code, specify
# your SCM below:
# set :scm, :subversion
task :fix_perms_before do
cmd_str = "sudo bash -c 'if [ ! -e #{deploy_to}/shared/cached-copy ];
then \
mkdir -p #{deploy_to}/shared/cached-copy; \
fi'"
run cmd_str
end
namespace :deploy do
desc "Reload apache"
task :restart, :roles => :web do
run "sudo /etc/init.d/apache2 reload"
end
end
role :web, "10.1.90.80"
set :deploy_via, :remote_cache
set :copy_cache, true
set :copy_strategy, :export
set :deploy_to, "/var/www/corpsite"
set :current_deploy_dir, "#{deploy_to}/current"
set :keep_releases, 10
set :use_sudo, true
set :scm_password, "mypass"
before :deploy, :fix_perms_before
=========================================
But I get this error:
copying the cached version to /var/www/corpsite/releases/20090706142841
* executing "cp -RPp /var/www/corpsite/shared/cached-copy
/var/www/corpsite/releases/20090706142841 && (echo 3487 >
/var/www/corpsite/releases/20090706142841/REVISION)"
servers: ["10.1.90.80"]
[10.1.90.80] executing command
*** [err :: 10.1.90.80] cp: cannot create directory
`/var/www/corpsite/releases/20090706142841': Permission denied
command finished
This is the kind of thing I was hoping :use_sudo could get around...
--
Joe McDonagh
Operations Engineer
www.colonfail.com
--
Rafa
It appears that for certain pieces of the deploy tasks, use_sudo is
ignored. I've filed a bug on it, not positive what the outcome will be
but from the sound of it, Lee is going to try to get a patch in.
--