Capistrano connect to second server via :app, :web, :db primary machine

295 views Asked by At

I'm trying to make capistrano connect to a second server than the ones defined throught the 'role' definitions, in order to connect to one specific server, run a mysqldump on it, and scp the fresh dump to the :app,:web host.

So here's what I wrote :

server "staging.app.com", :app, :web, :db, :primary => true
server "legacyserver.com", :origin_server

I wish to connect to :origin_server only when needed, i.e when I need to run mysqldump and scp of it. But, when launching cap %env% deploy, capistrano logs :

    servers: ["staging.app.com", "legacyserver.com"]

and tries to log to both machines using the same entered credentials.

What could I be missing ? Thanks.

1

There are 1 answers

0
Charlie Greene On

You can set the :orginal _server to be a non release server. To do this you need to add this:

server "legacyserver.com", :orginal_server, :no_release => true

Now tasks will only be run on this server if specifically stated.