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!, #default_deploy_config?, #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, #production_source_defaults, #prompt_required, #redactor, #remote_version, #shared_config_path, #shared_config_source_defaults, #shared_config_template, #validate_deploy_config, #validate_deploy_mode?, #version_remote_mode?, #write_init_file
Class Method Details
.basename ⇒ Object
230
231
232
|
# File 'lib/kamal_backup/cli.rb', line 230
def self.basename
CLI.basename
end
|
Instance Method Details
#local(snapshot = "latest") ⇒ Object
235
236
237
238
|
# File 'lib/kamal_backup/cli.rb', line 235
def local(snapshot = "latest")
confirm!("Restore #{snapshot} into the local database and Active Storage path? This will overwrite local data.")
puts(JSON.pretty_generate(local_app.restore_to_local_machine(snapshot)))
end
|
#production(snapshot = "latest") ⇒ Object
241
242
243
244
245
246
247
248
249
|
# File 'lib/kamal_backup/cli.rb', line 241
def production(snapshot = "latest")
confirm!("Restore #{snapshot} into the production database and Active Storage path? 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
|