Dynamic deploy_to

61 views
Skip to first unread message

Juan Carlos Roca

unread,
May 13, 2014, 5:26:59 PM5/13/14
to capis...@googlegroups.com
Versions:
  • Ruby 1.9.3p194
  • Capistrano 3.2.1
Platform:
  • Working on Node.js
Files:
  • Capfile
  • deploy.rb
  • Stage files (production.rb, staging.rb)
Im deploying to a single server and having it run several node processes, so Im having each process as an individual server on the config and I wish to define a per server :deploy_to variable how could I do this?

Also when I setup a server with the Extended Server Syntax "server 'server.com', user: 'user', roles: %w{app}" how can I fetch the user variable?

Lee Hambley

unread,
May 14, 2014, 3:34:57 AM5/14/14
to capistrano
Im deploying to a single server and having it run several node processes, so Im having each process as an individual server on the config and I wish to define a per server :deploy_to variable how could I do this?

You can't really, the idea is that each deploy is the same, everywhere. That said, if you are having a really custom deployment, you can use Rake+SSHKit to do whatever you need, see some of the examples: https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/347097f7-6cc8-48b3-ab9f-2750caf1504c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruno Sutic

unread,
May 14, 2014, 10:07:37 AM5/14/14
to capis...@googlegroups.com
Hi Juan,
to fetch the user for a server you can try something like this:
task :test_task do
  on roles :all do |host|
    my_user = host.user
  end
end

or to get all users:
task :test_task_all_users do
  users_array = roles(:all).map(&:user)
end

Hope that helps.

As for the general solution - you should be better off by following Lee's advice.
Reply all
Reply to author
Forward
0 new messages