Forum: Rails deployment Are these capistrano tasks being executed on all roles ?!?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1636be0d225f58321def06fb92ab93a9?d=identicon&s=25 James Dinkel (jdinkel)
on 2009-05-23 08:21
I have an Apache front-end web server "server1", an application server
with Ruby and Thin "server2", and a MySQL database server "server3".
Before I do a deployment I wanted to check what Capistrano is going to
do to each server so I've been digging around the default recipes in the
source code.

If I'm not mistaken, it seems that a lot of recipes are needlessly
running on all three servers when the recipe only needs to be run on the
application server.  For instance here is the deploy:setup task:

  task :setup, :except => { :no_release => true } do
    dirs = [deploy_to, releases_path, shared_path]
    dirs += shared_children.map { |d| File.join(shared_path, d) }
    run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w
#{dirs.join(' ')}"
  end

Since it doesn't have a :roles parameter, it would seem this is going to
run on all three servers even though server1 and server3 won't need
these directories and won't need the application files copied to them
(which the update_code task is also needlessly running on all three
servers) when this task should only run on server2.  By the default it
looks like my application structure will be copied to three servers even
though it's only used on one.

So why don't these default to just running on the server(s) in the :app
role?
This topic is locked and can not be replied to.