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_command_mode?, #remote_version, #shared_config_path, #shared_config_source_defaults, #shared_config_template, #validate_deploy_config, #write_init_file
Class Method Details
.basename ⇒ Object
227
228
229
|
# File 'lib/kamal_backup/cli.rb', line 227
def self.basename
CLI.basename
end
|
Instance Method Details
#local(snapshot = "latest") ⇒ Object
232
233
234
235
|
# File 'lib/kamal_backup/cli.rb', line 232
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
238
239
240
241
242
243
244
245
246
|
# File 'lib/kamal_backup/cli.rb', line 238
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
|