uff_db_loader 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -7
- data/lib/configuration.rb +1 -1
- data/lib/uff_db_loader/tasks/uff_db_loader.rake +28 -22
- data/lib/uff_db_loader/templates/uff_db_loader_initializer.erb +18 -0
- data/lib/uff_db_loader/version.rb +1 -1
- data/lib/uff_db_loader.rb +141 -101
- data/uff_db_loader.gemspec +1 -0
- metadata +10 -9
- data/lib/uff_db_loader/tasks/remote_database.rake +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28a567bb65dcdcc545605a5b8b921abe6fb6b4b666d97928e659bf535a1675ed
|
4
|
+
data.tar.gz: 4deffc2f8bad009cd16d04f08280765be75042da0f6e6e97d488addd22a51065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b2e2a27364e1afccda77edf18218c9c0862ee0ef389126e745848fceb08fb9fb73b042e07a71a9bddacc2818262d36c9ba109cadc5840c1c3b6175190ccfb5
|
7
|
+
data.tar.gz: d8ddddf06be94aa6d2799e7beaeff371c2897cbb7cf6e83855ed112325cc2796732c23082214aa9aa938be023f881e354d2607197dd01a9923777962068c555f
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add this line to your application's Gemfile
|
9
|
+
Add this line to your application's `Gemfile`:
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
gem 'uff_db_loader'
|
@@ -20,14 +20,16 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install uff_db_loader
|
22
22
|
|
23
|
+
Run the installation script:
|
24
|
+
|
25
|
+
$ bin/rails uff_db_loader:install
|
26
|
+
|
23
27
|
## Configuration
|
24
28
|
|
25
29
|
You can configure the gem by running the following during the initialization of the Rails app:
|
26
30
|
```ruby
|
27
|
-
# frozen_string_literal: true
|
28
|
-
|
29
31
|
UffDbLoader.configure do |config|
|
30
|
-
config.environments = ['
|
32
|
+
config.environments = ['staging', 'production']
|
31
33
|
config.ssh_user = 'Francina'
|
32
34
|
config.ssh_host = 'host.of.yoursite'
|
33
35
|
config.db_name = 'twotter'
|
@@ -43,10 +45,13 @@ Make sure the app's database user has the superuser role. Otherwise the app will
|
|
43
45
|
|
44
46
|
## Usage
|
45
47
|
|
46
|
-
`uff_db_loader`
|
47
|
-
`dump` will only create and download a current database dump, while `load`, will do the same and restore the database content into a new database and gives instructions on how to use it in development.
|
48
|
-
|
48
|
+
`uff_db_loader` can be called like `bin/rails uff_db_loader:<task>` where `<task>` is one of the following:
|
49
49
|
|
50
|
+
- `dump`: Dumps a remote database from a selected environment and downloads it
|
51
|
+
- `restore`: Restores a downloaded dump into a local database
|
52
|
+
- `switch`: Selects a restored local database to use
|
53
|
+
- `load`: Dumps a remote database from a selected environment and downloads it then restores and selects the database
|
54
|
+
- `prune`: Delete all downloaded db dumps and removes all databases created by UffDbLoader
|
50
55
|
|
51
56
|
## Development
|
52
57
|
|
data/lib/configuration.rb
CHANGED
@@ -8,7 +8,7 @@ module UffDbLoader
|
|
8
8
|
attr_accessor :environments, :ssh_host, :ssh_user, :db_name, :db_system, :app_name, :dumps_directory, :database_config_file
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
@environments =
|
11
|
+
@environments = nil
|
12
12
|
@ssh_host = nil
|
13
13
|
@ssh_user = nil
|
14
14
|
@db_name = nil
|
@@ -3,9 +3,11 @@
|
|
3
3
|
require "tty-prompt"
|
4
4
|
|
5
5
|
namespace :uff_db_loader do
|
6
|
-
desc "
|
6
|
+
desc "Set up UffDbLoader"
|
7
7
|
task install: :environment do
|
8
|
-
UffDbLoader.
|
8
|
+
UffDbLoader.create_initializer
|
9
|
+
|
10
|
+
puts "👶 Created a Rails initializer file at #{UffDbLoader.initializer_path}."
|
9
11
|
|
10
12
|
if UffDbLoader.setup_dynamic_database_name_in_config
|
11
13
|
puts "🤖 Updated #{UffDbLoader.config.database_config_file}. Happy hacking, beep boop!"
|
@@ -15,7 +17,7 @@ namespace :uff_db_loader do
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
desc "Dumps a remote database to #{UffDbLoader.config.dumps_directory}"
|
20
|
+
desc "Dumps a remote database from a selected environment to #{UffDbLoader.config.dumps_directory}"
|
19
21
|
task dump: :environment do
|
20
22
|
prompt = TTY::Prompt.new
|
21
23
|
environment = prompt.select("Which environment should we get the dump from?", UffDbLoader.config.environments)
|
@@ -23,22 +25,7 @@ namespace :uff_db_loader do
|
|
23
25
|
UffDbLoader.dump_from(environment)
|
24
26
|
end
|
25
27
|
|
26
|
-
desc "
|
27
|
-
task load: :environment do
|
28
|
-
UffDbLoader.ensure_installation!
|
29
|
-
|
30
|
-
prompt = TTY::Prompt.new
|
31
|
-
environment = prompt.select("Which environment should we get the dump from?", UffDbLoader.config.environments)
|
32
|
-
UffDbLoader.ensure_valid_environment!(environment)
|
33
|
-
result_file_path = UffDbLoader.dump_from(environment)
|
34
|
-
|
35
|
-
puts "🤓 Reading from to #{result_file_path}"
|
36
|
-
|
37
|
-
database_name = File.basename(result_file_path, ".*")
|
38
|
-
UffDbLoader.load_dump_into_database(database_name)
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "Loads an existing dump into the local database"
|
28
|
+
desc "Restores a downloaded dump into a local database"
|
42
29
|
task restore: :environment do
|
43
30
|
UffDbLoader.ensure_installation!
|
44
31
|
|
@@ -49,7 +36,7 @@ namespace :uff_db_loader do
|
|
49
36
|
UffDbLoader.load_dump_into_database(database_name)
|
50
37
|
end
|
51
38
|
|
52
|
-
desc "
|
39
|
+
desc "Selects a restored local database to use"
|
53
40
|
task switch: :environment do
|
54
41
|
UffDbLoader.ensure_installation!
|
55
42
|
|
@@ -58,13 +45,32 @@ namespace :uff_db_loader do
|
|
58
45
|
new_database = prompt.select("Which database do you want to switch to?", databases)
|
59
46
|
|
60
47
|
UffDbLoader.remember_database_name(new_database)
|
61
|
-
|
48
|
+
UffDbLoader.restart_rails_server
|
62
49
|
|
63
50
|
puts "♻️ Restarted rails server with new database."
|
64
51
|
end
|
65
52
|
|
66
|
-
desc "
|
53
|
+
desc "Dumps a remote database from a selected environment to #{UffDbLoader.config.dumps_directory}, then restores and selects the database"
|
54
|
+
task load: :environment do
|
55
|
+
UffDbLoader.ensure_installation!
|
56
|
+
|
57
|
+
prompt = TTY::Prompt.new
|
58
|
+
environment = prompt.select("Which environment should we get the dump from?", UffDbLoader.config.environments)
|
59
|
+
UffDbLoader.ensure_valid_environment!(environment)
|
60
|
+
result_file_path = UffDbLoader.dump_from(environment)
|
61
|
+
|
62
|
+
puts "🤓 Reading from to #{result_file_path}"
|
63
|
+
|
64
|
+
database_name = File.basename(result_file_path, ".*")
|
65
|
+
UffDbLoader.load_dump_into_database(database_name)
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Delete all downloaded db dumps and removes all databases created by UffDbLoader"
|
67
69
|
task prune: :environment do
|
70
|
+
# switch to default db so we can also drop the currently connected database
|
71
|
+
UffDbLoader.remember_database_name("")
|
72
|
+
ActiveRecord::Base.connection.reconnect!
|
73
|
+
|
68
74
|
UffDbLoader.databases.each do |database_name|
|
69
75
|
puts "Dropping #{database_name}"
|
70
76
|
UffDbLoader.drop_database(database_name)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Check out our README: https://github.com/rmehner/uff_db_loader/blob/main/README.md
|
4
|
+
|
5
|
+
if defined?(UffDbLoader)
|
6
|
+
UffDbLoader.configure do |config|
|
7
|
+
config.ssh_user = 'SSH_USER'
|
8
|
+
config.ssh_host = 'HOST_OF_YOUR_SITE'
|
9
|
+
config.db_name = 'YOUR_DATABASE_NAME'
|
10
|
+
config.db_system = <%= used_database_system %> # Possible values are :postgresql and :mysql
|
11
|
+
config.environments = <%= environments %>
|
12
|
+
|
13
|
+
# Optional settings:
|
14
|
+
# config.app_name = 'my_app' # Defaults to the Rails app name
|
15
|
+
# config.dumps_directory = '/path/to/dumps' # Defaults to Rails.root.join('dumps')
|
16
|
+
# config.database_config_file = 'path/to/database.yml' # Defaults to Rails.root.join('config', 'database.yml')
|
17
|
+
end
|
18
|
+
end
|
data/lib/uff_db_loader.rb
CHANGED
@@ -6,143 +6,183 @@ require "configuration"
|
|
6
6
|
module UffDbLoader
|
7
7
|
require "railtie"
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
class << self
|
10
|
+
def config
|
11
|
+
@configuration ||= Configuration.new
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def reset
|
15
|
+
@configuration = Configuration.new
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
def configure
|
19
|
+
yield(config)
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
def restart_rails_server
|
23
|
+
system("bin/rails restart")
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
config.dumps_directory,
|
28
|
-
Time.now.strftime("#{config.app_name}_#{environment}_%Y_%m_%d_%H_%M_%S.#{config.database_system.dump_extension}")
|
29
|
-
)
|
30
|
-
end
|
26
|
+
def dump_from(environment)
|
27
|
+
FileUtils.mkdir_p(config.dumps_directory)
|
31
28
|
|
32
|
-
|
33
|
-
FileUtils.mkdir_p(config.dumps_directory)
|
29
|
+
puts "⬇️ Creating dump ..."
|
34
30
|
|
35
|
-
|
31
|
+
target = dump_file_path(Time.now.strftime("#{config.app_name}_#{environment}_%Y_%m_%d_%H_%M_%S)"))
|
36
32
|
|
37
|
-
|
33
|
+
command_successful = system(dump_command(environment, target))
|
34
|
+
raise "Command did not run succesful: #{dump_command(environment, target)}" unless command_successful
|
38
35
|
|
39
|
-
|
40
|
-
raise "Command did not run succesful: #{dump_command(environment, target)}" unless command_successful
|
36
|
+
puts "✅ Succesfully dumped to #{target}"
|
41
37
|
|
42
|
-
|
38
|
+
target
|
39
|
+
end
|
43
40
|
|
44
|
-
|
45
|
-
|
41
|
+
def ensure_valid_environment!(environment)
|
42
|
+
unless config.environments.include?(environment)
|
43
|
+
raise ForbiddenEnvironmentError, "Invalid environment: #{environment}."
|
44
|
+
end
|
45
|
+
end
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
def prune_dump_directory
|
48
|
+
FileUtils.rm_rf("#{config.dumps_directory}/.", secure: true)
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
.dump_command_template
|
55
|
-
.gsub("%environment%", environment)
|
56
|
-
.gsub("%host%", config.ssh_host)
|
57
|
-
.gsub("%user%", config.ssh_user)
|
58
|
-
.gsub("%database%", config.database)
|
59
|
-
.gsub("%target%", target)
|
60
|
-
.gsub("%app_name%", config.app_name)
|
61
|
-
end
|
51
|
+
def create_database(database_name)
|
52
|
+
config.database_system.create_database(database_name)
|
53
|
+
end
|
62
54
|
|
63
|
-
|
64
|
-
|
65
|
-
raise ForbiddenEnvironmentError, "Invalid environment: #{environment}."
|
55
|
+
def drop_database(database_name)
|
56
|
+
config.database_system.drop_database(database_name)
|
66
57
|
end
|
67
|
-
end
|
68
58
|
|
69
|
-
|
70
|
-
|
71
|
-
|
59
|
+
def databases
|
60
|
+
config.database_system.list_databases.select do |line|
|
61
|
+
line =~ /#{config.app_name}_(#{config.environments.join("|")})_(\d|_)+/
|
62
|
+
end
|
63
|
+
end
|
72
64
|
|
73
|
-
|
74
|
-
|
75
|
-
end
|
65
|
+
def setup_dynamic_database_name_in_config
|
66
|
+
old_database_name = Rails.configuration.database_configuration["development"]["database"]
|
76
67
|
|
77
|
-
|
78
|
-
config.database_system.drop_database(database_name)
|
79
|
-
end
|
68
|
+
return false if old_database_name.nil?
|
80
69
|
|
81
|
-
|
82
|
-
|
83
|
-
|
70
|
+
old_config = File.read(UffDbLoader.config.database_config_file)
|
71
|
+
new_config = old_config.sub(old_database_name, database_name_template(old_database_name))
|
72
|
+
File.write(UffDbLoader.config.database_config_file, new_config)
|
84
73
|
end
|
85
|
-
end
|
86
74
|
|
87
|
-
|
88
|
-
|
89
|
-
|
75
|
+
def current_database_name
|
76
|
+
File.read(database_name_file).strip.presence
|
77
|
+
rescue IOError, Errno::ENOENT => e
|
78
|
+
puts "Could not read #{database_name_file}. #{e.message} – Falling back to default database. 🥱"
|
79
|
+
end
|
80
|
+
|
81
|
+
def remember_database_name(database_name)
|
82
|
+
File.write(database_name_file, database_name)
|
83
|
+
end
|
90
84
|
|
91
|
-
|
92
|
-
|
85
|
+
def ensure_installation!
|
86
|
+
unless File.read(UffDbLoader.config.database_config_file).include?("UffDbLoader.current_database_name")
|
87
|
+
raise InstallationDidNotRunError, "Please run bin/rails uff_db_loader:install"
|
88
|
+
end
|
89
|
+
end
|
93
90
|
|
94
|
-
|
91
|
+
def load_dump_into_database(database_name)
|
92
|
+
UffDbLoader.drop_database(database_name)
|
93
|
+
UffDbLoader.create_database(database_name)
|
95
94
|
|
96
|
-
|
97
|
-
new_config = old_config.sub(old_database_name, database_name_template(old_database_name))
|
98
|
-
File.write(UffDbLoader.config.database_config_file, new_config)
|
99
|
-
end
|
95
|
+
puts "🗂 Created database #{database_name}"
|
100
96
|
|
101
|
-
|
102
|
-
File.read(database_name_file).strip.presence
|
103
|
-
rescue IOError, Errno::ENOENT => e
|
104
|
-
puts "Could not read #{database_name_file}. #{e.message}"
|
105
|
-
end
|
97
|
+
dump_file_path = dump_file_path(database_name)
|
106
98
|
|
107
|
-
|
108
|
-
|
109
|
-
|
99
|
+
command_successful = system(restore_command(database_name, dump_file_path))
|
100
|
+
raise "Command did not run succesful: #{restore_command(database_name, dump_file_path)}" unless command_successful
|
101
|
+
|
102
|
+
puts "✅ Succesfully loaded #{dump_file_path} into #{database_name}"
|
103
|
+
|
104
|
+
remember_database_name(database_name)
|
105
|
+
restart_rails_server
|
110
106
|
|
111
|
-
|
112
|
-
unless File.read(UffDbLoader.config.database_config_file).include?("UffDbLoader.current_database_name")
|
113
|
-
raise InstallationDidNotRunError, "Please run bin/rails uff_db_loader:install"
|
107
|
+
puts "♻️ Restarted rails server with new database."
|
114
108
|
end
|
115
|
-
end
|
116
109
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
"#{database_name}.#{config.database_system.dump_extension}"
|
121
|
-
)
|
122
|
-
end
|
110
|
+
def initializer_path
|
111
|
+
File.join(__dir__, "uff_db_loader", "templates", "uff_db_loader_initializer.erb")
|
112
|
+
end
|
123
113
|
|
124
|
-
|
125
|
-
|
126
|
-
UffDbLoader.create_database(database_name)
|
114
|
+
def create_initializer
|
115
|
+
template = ERB.new(File.read(initializer_path))
|
127
116
|
|
128
|
-
|
117
|
+
File.write(
|
118
|
+
Rails.root.join("config", "initializers", "uff_db_loader.rb"),
|
119
|
+
template.result_with_hash(
|
120
|
+
used_database_system: used_database_system,
|
121
|
+
environments: environments
|
122
|
+
)
|
123
|
+
)
|
124
|
+
end
|
129
125
|
|
130
|
-
|
126
|
+
private
|
131
127
|
|
132
|
-
|
133
|
-
|
128
|
+
def database_name_file
|
129
|
+
Rails.root.join("tmp", "uff_db_loader_database_name")
|
130
|
+
end
|
134
131
|
|
135
|
-
|
132
|
+
def dump_filename(environment)
|
133
|
+
File.join(
|
134
|
+
config.dumps_directory,
|
135
|
+
Time.now.strftime("#{config.app_name}_#{environment}_%Y_%m_%d_%H_%M_%S.#{config.database_system.dump_extension}")
|
136
|
+
)
|
137
|
+
end
|
136
138
|
|
137
|
-
|
138
|
-
|
139
|
+
def dump_command(environment, target)
|
140
|
+
config
|
141
|
+
.database_system
|
142
|
+
.dump_command_template
|
143
|
+
.gsub("%environment%", environment)
|
144
|
+
.gsub("%host%", config.ssh_host)
|
145
|
+
.gsub("%user%", config.ssh_user)
|
146
|
+
.gsub("%database%", config.database)
|
147
|
+
.gsub("%target%", target)
|
148
|
+
.gsub("%app_name%", config.app_name)
|
149
|
+
end
|
139
150
|
|
140
|
-
|
141
|
-
|
151
|
+
def restore_command(database_name, result_file_path)
|
152
|
+
config.database_system.restore_command(database_name, result_file_path)
|
153
|
+
end
|
154
|
+
|
155
|
+
def database_name_template(old_database_name)
|
156
|
+
"<%= defined?(UffDbLoader) && UffDbLoader.current_database_name || '#{old_database_name}' %>"
|
157
|
+
end
|
158
|
+
|
159
|
+
def dump_file_path(database_name)
|
160
|
+
File.join(
|
161
|
+
config.dumps_directory,
|
162
|
+
"#{database_name}.#{config.database_system.dump_extension}"
|
163
|
+
)
|
164
|
+
end
|
165
|
+
|
166
|
+
def used_database_system
|
167
|
+
case Rails.configuration.database_configuration["development"]["adapter"]
|
168
|
+
when "mysql", "mysql2", "trilogy"
|
169
|
+
":mysql"
|
170
|
+
when "postgresql"
|
171
|
+
":postgresql"
|
172
|
+
else
|
173
|
+
puts "🙃 Could not automatically determine your used database system. Please adapt in the initializer."
|
174
|
+
":unknown"
|
175
|
+
end
|
176
|
+
end
|
142
177
|
|
143
|
-
|
178
|
+
def environments
|
179
|
+
ActiveRecord::Base.configurations.configurations.to_a.map(&:env_name) - ["test", "development"]
|
180
|
+
end
|
181
|
+
|
182
|
+
class ForbiddenEnvironmentError < StandardError; end
|
144
183
|
|
145
|
-
|
184
|
+
class UnknownDatabaseSystem < StandardError; end
|
146
185
|
|
147
|
-
|
186
|
+
class InstallationDidNotRunError < StandardError; end
|
187
|
+
end
|
148
188
|
end
|
data/uff_db_loader.gemspec
CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
|
9
9
|
spec.summary = "Allows to dump, download and restore databases from docker servers."
|
10
10
|
spec.description = "Allows to dump, download and restore databases from servers with a specific docker setup, that UFF uses commonly."
|
11
|
+
spec.post_install_message = "Please run `bin/rails uff_db_loader:install` to complete the installation."
|
11
12
|
spec.homepage = "https://github.com/rmehner/uff_db_loader"
|
12
13
|
spec.license = "MIT"
|
13
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uff_db_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Hellwig
|
8
8
|
- Fynn Heintz
|
9
9
|
- Robin Mehner
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-09-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: tty-prompt
|
@@ -79,8 +79,8 @@ files:
|
|
79
79
|
- lib/uff_db_loader.rb
|
80
80
|
- lib/uff_db_loader/mysql.rb
|
81
81
|
- lib/uff_db_loader/postgresql.rb
|
82
|
-
- lib/uff_db_loader/tasks/remote_database.rake
|
83
82
|
- lib/uff_db_loader/tasks/uff_db_loader.rake
|
83
|
+
- lib/uff_db_loader/templates/uff_db_loader_initializer.erb
|
84
84
|
- lib/uff_db_loader/version.rb
|
85
85
|
- uff_db_loader.gemspec
|
86
86
|
homepage: https://github.com/rmehner/uff_db_loader
|
@@ -88,10 +88,11 @@ licenses:
|
|
88
88
|
- MIT
|
89
89
|
metadata:
|
90
90
|
bug_tracker_uri: https://github.com/rmehner/uff_db_loader/issues
|
91
|
-
changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/
|
91
|
+
changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/2.0.0
|
92
92
|
homepage_uri: https://github.com/rmehner/uff_db_loader
|
93
|
-
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/
|
94
|
-
post_install_message:
|
93
|
+
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/2.0.0
|
94
|
+
post_install_message: Please run `bin/rails uff_db_loader:install` to complete the
|
95
|
+
installation.
|
95
96
|
rdoc_options: []
|
96
97
|
require_paths:
|
97
98
|
- lib
|
@@ -106,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
- !ruby/object:Gem::Version
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
110
|
-
signing_key:
|
110
|
+
rubygems_version: 3.3.8
|
111
|
+
signing_key:
|
111
112
|
specification_version: 4
|
112
113
|
summary: Allows to dump, download and restore databases from docker servers.
|
113
114
|
test_files: []
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "tty-prompt"
|
4
|
-
|
5
|
-
namespace :remote_database do
|
6
|
-
desc "Dumps a remote database to #{UffDbLoader.config.dumps_directory}"
|
7
|
-
task dump: :environment do
|
8
|
-
puts "🧐 Please note this task is called 'uff_db_loader:dump' now."
|
9
|
-
Rake::Task["uff_db_loader:dump"].invoke
|
10
|
-
end
|
11
|
-
|
12
|
-
desc "Gets a dump from remote and loads it into the local database"
|
13
|
-
task load: :environment do
|
14
|
-
puts "🧐 Please note this task is called 'uff_db_loader:load' now."
|
15
|
-
Rake::Task["uff_db_loader:load"].invoke
|
16
|
-
end
|
17
|
-
|
18
|
-
desc "Delete all downloaded db dumps and emove all databases created by UffDbLoader"
|
19
|
-
task prune: :environment do
|
20
|
-
puts "🧐 Please note this task is called 'uff_db_loader:prune' now."
|
21
|
-
Rake::Task["uff_db_loader:prune"].invoke
|
22
|
-
end
|
23
|
-
end
|