remote_database_importer 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e87b7d089101bd0f324f2dcaf9be16c2a038f9d369c4d18f86362492c7e25218
|
4
|
+
data.tar.gz: ea76970e0e136fc5469bf4f82fec6dd90bb7b7bad5622947c375a9a6640031fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc71eabc31b5df7c4238fd0196733eb942f8704a31f3c33ba4373eab4278ec5be93828065fdaf6d6af52f9cad556b40aea692ed0d8d6756a8a20661b72f84e04
|
7
|
+
data.tar.gz: 14e17552a0ed444ad14904245bcb7adac5d4c5d795be684bb0acaecaefa1f12ec868cfe88034bc90413fd5986b8b99c881ea0a61f04734717bbf56c0aae0316c
|
data/CHANGELOG.md
CHANGED
@@ -4,10 +4,10 @@ module RemoteDatabaseImporter
|
|
4
4
|
require_relative "colorize"
|
5
5
|
|
6
6
|
attr_accessor :config
|
7
|
-
|
7
|
+
|
8
8
|
def initialize
|
9
9
|
@config = TTY::Config.new
|
10
|
-
|
10
|
+
|
11
11
|
config.filename = "remote_database_importer"
|
12
12
|
config.extname = ".yml"
|
13
13
|
config.append_path Dir.pwd
|
@@ -63,6 +63,9 @@ module RemoteDatabaseImporter
|
|
63
63
|
else
|
64
64
|
postgres_port = ask("Enter the database port for the pg_dump command:", default: "5432")
|
65
65
|
end
|
66
|
+
|
67
|
+
puts Colorize.green("Define custom commands that run after successful import:")
|
68
|
+
custom_commands = ask("Enter semicolon separated commands that should run after importing the DB:", default: "rake db:migrate; echo 'All Done'")
|
66
69
|
puts
|
67
70
|
|
68
71
|
env_config = {
|
@@ -77,7 +80,8 @@ module RemoteDatabaseImporter
|
|
77
80
|
"postgres_port" => postgres_port,
|
78
81
|
"ssh_user" => ssh_user,
|
79
82
|
"ssh_port" => ssh_port
|
80
|
-
}
|
83
|
+
},
|
84
|
+
"custom_commands" => custom_commands
|
81
85
|
}
|
82
86
|
}
|
83
87
|
config.append(env_config, to: :environments)
|
@@ -90,11 +94,6 @@ module RemoteDatabaseImporter
|
|
90
94
|
end
|
91
95
|
end
|
92
96
|
|
93
|
-
puts Colorize.green("Define custom commands that run after successful import:")
|
94
|
-
custom_commands = ask("Enter semicolon separated commands that should run after importing the DB:", default: "rake db:migrate; echo 'All Done'")
|
95
|
-
puts
|
96
|
-
|
97
|
-
config.set(:custom_commands, value: custom_commands)
|
98
97
|
config.write
|
99
98
|
end
|
100
99
|
end
|
@@ -72,12 +72,12 @@ module RemoteDatabaseImporter
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def dump_remote_db
|
75
|
-
host
|
76
|
-
db_name
|
77
|
-
db_user
|
78
|
-
dump_type
|
79
|
-
ssh_user
|
80
|
-
ssh_port
|
75
|
+
host = current_environment["connection"]["host"]
|
76
|
+
db_name = current_environment["database"]["name"]
|
77
|
+
db_user = current_environment["database"]["user"]
|
78
|
+
dump_type = current_environment["connection"]["dump_type"]
|
79
|
+
ssh_user = current_environment["connection"]["ssh_user"]
|
80
|
+
ssh_port = current_environment["connection"]["ssh_port"]
|
81
81
|
postgres_port = current_environment["connection"]["postgres_port"]
|
82
82
|
|
83
83
|
if dump_type == "ssh_tunnel"
|
@@ -104,7 +104,7 @@ module RemoteDatabaseImporter
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def custom_commands
|
107
|
-
|
107
|
+
current_environment["custom_commands"]
|
108
108
|
end
|
109
109
|
|
110
110
|
def db_dump_location
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_database_importer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Vogt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-config
|