oneblackbear-obbistrano 1.0.19 → 1.0.20

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.
@@ -203,10 +203,16 @@ Capistrano::Configuration.instance(:must_exist).load do
203
203
  end
204
204
 
205
205
  task :setup_mysql do
206
+ set :user_to_add, "#{user}"
207
+ set :passwd_to_add, "#{password}"
206
208
  with_user("root", "#{root_pass}") do
207
209
  "#{databases}".each do |db|
208
- run "mysql -uroot -p#{root_pass} -e 'CREATE DATABASE #{db}'"
209
- run "musql -uroot -p#{root_pass} -e 'GRANT ALL PRIVILEGES ON `#{db}` . * TO '#{user_to_add}'@'localhost' IDENTIFIED BY '#{passwd_to_add}';"
210
+ begin
211
+ run "mysql -uroot -p#{root_pass} -e 'CREATE DATABASE #{db}'"
212
+ run "musql -uroot -p#{root_pass} -e 'GRANT ALL PRIVILEGES ON `#{db}` . * TO '#{user_to_add}'@'localhost' IDENTIFIED BY '#{passwd_to_add}';"
213
+ rescue
214
+ logger.info "Database #{db} already exists"
215
+ end
210
216
  end
211
217
  end
212
218
 
data/obbistrano.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{obbistrano}
5
- s.version = "1.0.19"
5
+ s.version = "1.0.20"
6
6
  s.authors = ["Ross Riley", "One Black Bear"]
7
7
  s.date = Time.now
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneblackbear-obbistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley