suitmymind-ubuntu-machine 0.3.1.1 → 0.3.1.2
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/capistrano/ext/ubuntu-machine/mysql.rb +10 -6
- metadata +2 -2
@@ -39,15 +39,19 @@ namespace :mysql do
|
|
39
39
|
db_name = Capistrano::CLI.ui.ask("Which database should we create: ")
|
40
40
|
db_username = Capistrano::CLI.ui.ask("Which database username should we create: ")
|
41
41
|
db_user_password = Capistrano::CLI.ui.ask("Choose a password for the new database username: ")
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
file_to_upload = Capistrano::CLI.ui.ask("Do you want to import a database file? (y/n) : ")
|
43
|
+
if file_to_upload == "y"
|
44
|
+
file = Capistrano::CLI.ui.ask("Which database file should we import (it must be located in #{default_local_files_path}): ")
|
45
|
+
upload "#{default_local_files_path}/#{file}", "#{file}"
|
46
|
+
end
|
45
47
|
create_db_tmp_file = "create_#{db_name}.sql"
|
46
48
|
put render("new_db", binding), create_db_tmp_file
|
47
49
|
run "mysql -u root -p#{db_root_password} < #{create_db_tmp_file}"
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
if file_to_upload == "y"
|
51
|
+
run "mysql -u root -p#{db_root_password} #{db_name} < #{file}"
|
52
|
+
run "rm #{file}"
|
53
|
+
end
|
54
|
+
run "rm #{create_db_tmp_file}"
|
51
55
|
end
|
52
56
|
|
53
57
|
desc "Install MySQL"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suitmymind-ubuntu-machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.1.
|
4
|
+
version: 0.3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Balthazar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-31 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|