capistrano_transmit 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -7
- data/capistrano_transmit.gemspec +1 -1
- data/lib/capistrano/transmit.rb +7 -12
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -32,19 +32,19 @@ Then add to your deploy.rb:
|
|
32
32
|
|
33
33
|
== Examples
|
34
34
|
|
35
|
-
cap transmit:get:mysql # Fetch the remote production MySQL database
|
36
|
-
|
37
|
-
cap transmit:get:assets # Fetch the remote assets into your local development environment
|
35
|
+
cap transmit:get:mysql # Fetch the remote production MySQL database
|
36
|
+
# and overwrite your local development database with it
|
37
|
+
cap transmit:get:assets # Fetch the remote assets into your local development environment
|
38
38
|
|
39
39
|
|
40
|
-
cap transmit:put:mysql # Overwrite the production MySQL database with your development data
|
40
|
+
cap transmit:put:mysql # Overwrite the production MySQL database with your development data
|
41
41
|
|
42
42
|
== Prerequisites
|
43
43
|
|
44
44
|
This Capistrano extension assumes some variables are present in your deploy.rb:
|
45
45
|
|
46
|
-
user
|
47
|
-
deploy_host
|
46
|
+
user # the SSH user for connecting to the deploy host
|
47
|
+
deploy_host # the host on which to run the db dump
|
48
48
|
|
49
49
|
|
50
|
-
Copyright (c) 2010 Joost Baaij, released under the MIT license
|
50
|
+
Copyright (c) 2010-2011 Joost Baaij, released under the MIT license.
|
data/capistrano_transmit.gemspec
CHANGED
data/lib/capistrano/transmit.rb
CHANGED
@@ -3,6 +3,13 @@ unless Capistrano::Configuration.respond_to?(:instance)
|
|
3
3
|
end
|
4
4
|
|
5
5
|
Capistrano::Configuration.instance.load do
|
6
|
+
|
7
|
+
_cset :user, ""
|
8
|
+
_cset :db_config { capture "cat #{current_path}/config/database.yml" }
|
9
|
+
_cset :db_remote { YAML::load(db_config)['production'] }
|
10
|
+
_cset :db_local { YAML::load_file("config/database.yml")['development'] }
|
11
|
+
_cset :dumpfile { "#{current_path}/tmp/#{db_remote['database']}.sql.gz" }
|
12
|
+
|
6
13
|
after "transmit:get:mysql", "transmit:cleanup"
|
7
14
|
after "transmit:put:mysql", "transmit:cleanup"
|
8
15
|
|
@@ -38,16 +45,4 @@ Capistrano::Configuration.instance.load do
|
|
38
45
|
end
|
39
46
|
end
|
40
47
|
|
41
|
-
set(:db_remote) do
|
42
|
-
db_config = capture "cat #{current_path}/config/database.yml"
|
43
|
-
YAML::load(db_config)['production']
|
44
|
-
end
|
45
|
-
|
46
|
-
set(:db_local) do
|
47
|
-
YAML::load_file("config/database.yml")['development']
|
48
|
-
end
|
49
|
-
|
50
|
-
set :dumpfile do
|
51
|
-
"#{current_path}/tmp/#{db_remote['database']}.sql.gz"
|
52
|
-
end
|
53
48
|
end
|