recipiez 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/recipiez/version.rb +1 -1
- data/recipes/deployment_recipiez.rb +2 -30
- metadata +2 -2
data/lib/recipiez/version.rb
CHANGED
@@ -90,35 +90,7 @@ namespace :recipiez do
|
|
90
90
|
|
91
91
|
desc "Dump database, copy it across and restore locally."
|
92
92
|
task :pull do
|
93
|
-
set_variables_from_yaml
|
94
|
-
archive = generate_archive(application)
|
95
|
-
filename = get_filename(application)
|
96
|
-
cmd = "mysqldump --opt --skip-add-locks -u #{db_user} "
|
97
|
-
cmd += " -h #{db_host} " if exists?('db_host')
|
98
|
-
cmd += " -p#{db_password} "
|
99
|
-
cmd += "#{database_to_dump} > #{archive}"
|
100
|
-
result = run(cmd)
|
101
|
-
|
102
|
-
cmd = "rsync -av -e \"ssh -p #{ssh_options[:port]} #{get_identities}\" #{user}@#{roles[:db].servers.first}:#{archive} #{dump_dir}#{filename}"
|
103
|
-
puts "running #{cmd}"
|
104
|
-
result = system(cmd)
|
105
|
-
puts result
|
106
|
-
run "rm #{archive}"
|
107
|
-
|
108
|
-
puts "Restoring db"
|
109
|
-
begin
|
110
|
-
`mysqladmin -u#{db_local_user} -p#{db_local_password} --force drop #{db_dev}`
|
111
|
-
rescue
|
112
|
-
# do nothing
|
113
|
-
end
|
114
|
-
`mysqladmin -u#{db_local_user} -p#{db_local_password} --force create #{db_dev}`
|
115
|
-
`cat #{dump_dir}#{get_filename(application)} | mysql -u#{db_local_user} -p#{db_local_password} #{db_dev}`
|
116
|
-
puts "All done!"
|
117
|
-
end
|
118
|
-
|
119
|
-
desc "Dump alternate database, copy it across and restore it locally"
|
120
|
-
task :pull_alternate do
|
121
|
-
set_variables_from_yaml(alternate_yaml_env)
|
93
|
+
set_variables_from_yaml(yaml_env)
|
122
94
|
archive = generate_archive(application)
|
123
95
|
filename = get_filename(application)
|
124
96
|
cmd = "mysqldump --opt --skip-add-locks -u #{db_user} "
|
@@ -144,7 +116,7 @@ namespace :recipiez do
|
|
144
116
|
puts "All done!"
|
145
117
|
end
|
146
118
|
|
147
|
-
|
119
|
+
desc "Push up the db"
|
148
120
|
task :push do
|
149
121
|
set_variables_from_yaml
|
150
122
|
filename = get_filename(application)
|