Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

find the deploy host based on the db server list

  • Loading branch information...
commit 60f1b23be79dcbe913eb0bdb646fc175a4b83f6b 1 parent 109e530
Joost Baaij authored
Showing with 7 additions and 5 deletions.
  1. +6 −4 README.rdoc
  2. +1 −1  lib/capistrano/transmit.rb
10 README.rdoc
View
@@ -24,7 +24,7 @@ Mac OS X development.
or in your +Gemfile+:
- gem 'capistrano_transmit'
+ gem 'capistrano_transmit', '~> 1.0.0'
Then add to your deploy.rb:
@@ -37,10 +37,12 @@ Then add to your deploy.rb:
== Prerequisites
-This Capistrano extension assumes some variables are present in your deploy.rb:
+You need Capistrano 2 for this gem to work.
- user # the SSH user for connecting to the deploy host
- deploy_host # the host on which to run the db dump
+A couple variables can be overridden by setting them in config/deploy.rb:
+
+ user # SSH user, defaults to nil, which falls back to your unix user
+ deploy_host # the host on which to run the db dump, falls back to your first db
Copyright (c) 2010-2011 Joost Baaij, released under the MIT license.
2  lib/capistrano/transmit.rb
View
@@ -5,7 +5,7 @@
Capistrano::Configuration.instance.load do
_cset :user, nil
- _cset(:deploy_host) { find_servers(:roles => :app).first.host }
+ _cset(:deploy_host) { find_servers(:roles => :db).first.host }
_cset(:db_config) { capture("cat #{current_path}/config/database.yml") }
_cset(:db_remote) { YAML::load(db_config)['production'] }
_cset(:db_local) { YAML::load_file("config/database.yml")['development'] }
Please sign in to comment.
Something went wrong with that request. Please try again.