Declare custom server and connect to it

18 views
Skip to first unread message

romain Simiand

unread,
Jan 30, 2012, 3:06:35 PM1/30/12
to capis...@googlegroups.com
Using Capistrano v2.6.0, I'm trying to get server I defined as server "staging.app.com", :app, :web, :db, :primary => true to connect to another server defined by myself in order to launch a mysqldump, and scp the resulting file.

My first issue, even before making both main server and mysql machine communicate, is to declare a server that is'nt :app, :web or :db (to keep these native
server types clean)

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 a lot


Peter

unread,
Jan 31, 2012, 10:40:50 AM1/31/12
to Capistrano
On Jan 30, 2:06 pm, romain Simiand <romain.simi...@gmail.com> wrote:
> Using Capistrano v2.6.0, I'm trying to get server I defined as *server
> "staging.app.com", :app, :web, :db, :primary => true* to connect to another
> server defined by myself in order to launch a mysqldump, and scp the
> resulting file.
>
> My first issue, even before making both main server and mysql machine
> communicate, is to declare a server that is'nt :app, :web or :db (to keep
> these native
> server types clean)
>
> 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 ?

I believe you're missing the :no_release => true option on your legacy
server. That will cause tasks declared as such to be skipped:

task :foo, :except => { :no_release => true } do
...
end

Which is most (all?) of the deploy based ones. You can then add tasks
which don't skip :no_release => true and have them execute on your
legacy server too. This is definitely true for role based definitions
and I'd imagine its the same for server based definitions.

\Peter
Reply all
Reply to author
Forward
0 new messages