recipiez 0.5.8 → 0.5.9
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 +15 -4
- metadata +3 -3
data/lib/recipiez/version.rb
CHANGED
@@ -122,14 +122,25 @@ namespace :recipiez do
|
|
122
122
|
put File.read("#{dump_dir}#{filename}"), filename
|
123
123
|
logger.debug 'Dropping db'
|
124
124
|
begin
|
125
|
-
|
125
|
+
if exists?('db_host')
|
126
|
+
# do nothing
|
127
|
+
else
|
128
|
+
run "mysqladmin -u#{db_user} -p#{db_password} --force drop #{database_to_dump}"
|
129
|
+
end
|
126
130
|
rescue
|
127
131
|
# do nothing
|
128
132
|
end
|
129
|
-
|
130
|
-
|
133
|
+
if exists?('db_host')
|
134
|
+
# do nothing
|
135
|
+
else
|
136
|
+
logger.debug 'Creating db'
|
137
|
+
run "mysqladmin -u#{db_user} -p#{db_password} --force create #{database_to_dump}"
|
138
|
+
end
|
131
139
|
logger.debug 'Restoring db'
|
132
|
-
|
140
|
+
cmd = "cat #{filename} | mysql -u#{db_user} "
|
141
|
+
cmd += "-h #{db_host} " if exists?('db_host')
|
142
|
+
cmd += "-p#{db_password} #{database_to_dump}"
|
143
|
+
run cmd
|
133
144
|
run "rm #{filename}"
|
134
145
|
end
|
135
146
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 9
|
9
|
+
version: 0.5.9
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alastair Brunton
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2013-09-
|
17
|
+
date: 2013-09-25 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|