Why don’t you add this to your deploy.rb file instead of using spinner
script?
set :mongrel_conf,
“/var/www/#{application}/current/config/mongrel_cluster.yml”
namespace :deploy do
namespace :mongrel do
[ :stop, :start, :restart ].each do |t|
desc “#{t.to_s.capitalize} the mongrel appserver”
task t, :roles => :app do
#invoke_command checks the use_sudo variable to determine how to
run th$
invoke_command “mongrel_rails cluster::#{t.to_s} -C
#{mongrel_conf}”,
end
end
end
desc “Custom restart task for mongrel cluster”
task :restart, :roles => :app, :except => { :no_release => true } do
deploy.mongrel.restart
end
desc “Custom start task for mongrel cluster”
task :start, :roles => :app do
deploy.mongrel.start
end
desc “Custom stop task for mongrel cluster”
task :stop, :roles => :app do
deploy.mongrel.stop
end
end
It works great for me … I haven’t tried achieving the same with your
approach because “I didn’t get it” when reading about it for the first
time… This works, because it overrides the default tasks for restarting
mongrel. So it works with “cap deploy” and of course with “cap
deploy:mongrel:start” etc.
Maybe I’m wrong… would be grateful if someone commented on the
differences between spinner script and this.
bye!
david
Jim N. wrote:
I’m having problems with the chmod command. I get the following error:
—ERROR------------------
D:\fapbox.com>cap deploy
[DEPRECATION] Capistrano.configuration is deprecated. Use
Capistrano::Configurat
ion.instance instead
- executing `deploy’
- executing `deploy:update’
** transaction: start
- executing `deploy:update_code’
- executing “svn checkout -q -r35 http://www.fapbox.com/svn/fapbox
/home/fapb
ox/releases/20070907194029 && (echo 35 >
/home/fapbox/releases/20070907194029/RE
VISION)”
servers: [“www.fapbox.com”]
Password:
[www.fapbox.com] executing command
command finished
- executing `deploy:finalize_update’
- executing “chmod -R g+w /home/fapbox/releases/20070907194029”
servers: [“www.fapbox.com”]
[www.fapbox.com] executing command
command finished
- executing “rm -rf /home/fapbox/releases/20070907194029/log
/home/fapbox/rele
ases/20070907194029/public/system
/home/fapbox/releases/20070907194029/tmp/pids
&&\n mkdir -p /home/fapbox/releases/20070907194029/public &&\n
mkdir -
p /home/fapbox/releases/20070907194029/tmp &&\n ln -s
/home/fapbox/shared/l
og /home/fapbox/releases/20070907194029/log &&\n ln -s
/home/fapbox/shared/
system /home/fapbox/releases/20070907194029/public/system &&\n ln
-s /home/
fapbox/shared/pids /home/fapbox/releases/20070907194029/tmp/pids”
servers: [“www.fapbox.com”]
[www.fapbox.com] executing command
command finished
- executing “find /home/fapbox/releases/20070907194029/public/images
/home/fap
box/releases/20070907194029/public/stylesheets
/home/fapbox/releases/20070907194
029/public/javascripts -exec touch -t 200709071940.47 {} ‘;’; true”
servers: [“www.fapbox.com”]
[www.fapbox.com] executing command
command finished
triggering after callbacks for `deploy:update_code’
- executing `fix_script_perms’
- executing “chmod 755
/home/fapbox/releases/20070907194029/script/spin”
servers: [“www.fapbox.com”]
[www.fapbox.com] executing command
** [out :: www.fapbox.com] chmod: cannot access
`/home/fapbox/releases/20070907
194029/script/spin’: No such file or directory
command finished
*** [deploy:update_code] rolling back
- executing “rm -rf /home/fapbox/releases/20070907194029; true”
servers: [“www.fapbox.com”]
[www.fapbox.com] executing command
command finished
command “chmod 755 /home/fapbox/releases/20070907194029/script/spin”
failed on w
ww.fapbox.com
This is my deploy.rb
—DEPLOY.RB----------------------
require ‘mongrel_cluster/recipes’
set :application, “fapbox”
set :repository, “http://www.fapbox.com/svn/#{application}”
set :deploy_to, “/home/#{application}”
set :runner, “root”
set :user, “root”
set :svn_username, “root”
set :svn_password, “ketimella9”
set :checkout, “export”
set :use_sudo, false
set :mongrel_conf, “#{current_path}/config/mongrel_cluster.yml”
role :app, “www.#{application}.com”
role :web, “www.#{application}.com”
role :db, “www.#{application}.com”, :primary => true
after “deploy:update_code”, :fix_script_perms
task :fix_script_perms do
run “chmod 755 #{latest_release}/script/spin”
end