How to disable the default deployment thread for a single role in capistrano 2.x?

I use simple capistrano to deploy a simple cluster written in node.

I defined the roles as follows:

role :boss, "bosshost"
role :worker, { get_worker_hosts }

I use capistrano default deploy dance + my own tasks to host the application workeron the servers.

The problem is that I do not want anything for boss, since this is only one script. Ideally, this will do:

namespace :boss
  task :update, :roles => [:boss]
    upload 'boss.js', "#{boss_home}/boss.js"
  end
  task :restart, :roles => [:boss]
    run "forever restart #{boss_home}/boss.js"
  end
end

I used :roles => [:worker]in all employee-related tasks that occur after deploy:finalize_update. However, the launch $ cap deploywill still contain incomplete files on the server boss.

capistrano, deploy worker?

+3
1

. , NFS, node .

, ( role):

server 'a-server.com', :app, :web, :service
server 'another-server.com', :service, :no_release => true

:no_release => true, . , . , , , :

task "my_task", :except => { :no_release => true } do
  # do stuff here...
  # Example of using a role with `run`
  run "sudo /etc/init.d/nodejs-#{application} restart", :roles => :service
end

, !

+3

All Articles