Class: KamalBackup::CLI::RestoreCLI
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Helpers
#accessory_name, #accessory_reboot_command, #bridge, #command_env, #confirm!, #deploy_snippet, #deployment_mode?, #direct_app, #ensure_remote_version_match!, #exec_remote, #init_config_root, #local_app, #local_command_config, #local_preferences, #print_remote_version_status, #prompt_required, #redactor, #remote_version, #shared_config_path, #shared_config_template, #write_init_file
Class Method Details
.basename ⇒ Object
186
187
188
|
# File 'lib/kamal_backup/cli.rb', line 186
def self.basename
CLI.basename
end
|
Instance Method Details
#local(snapshot = "latest") ⇒ Object
191
192
193
194
|
# File 'lib/kamal_backup/cli.rb', line 191
def local(snapshot = "latest")
confirm!("Restore #{snapshot} into the local database and local files? This will overwrite local data.")
puts(JSON.pretty_generate(local_app.restore_to_local_machine(snapshot)))
end
|
#production(snapshot = "latest") ⇒ Object
197
198
199
200
201
202
203
204
205
|
# File 'lib/kamal_backup/cli.rb', line 197
def production(snapshot = "latest")
confirm!("Restore #{snapshot} into the production database and production files? This will overwrite production data.")
if deployment_mode?
exec_remote(["kamal-backup", "restore", "production", snapshot, "--yes"])
else
puts(JSON.pretty_generate(direct_app.restore_to_production(snapshot)))
end
end
|