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!, #confirm_production_restore!, #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_restore_confirmation_config, #production_source_defaults, #prompt_required, #redactor, #remote_command_mode?, #remote_version, #require_typed_confirmation, #shared_config_path, #shared_config_source_defaults, #shared_config_template, #validate_deploy_config, #write_init_file
Class Method Details
.basename ⇒ Object
264
265
266
|
# File 'lib/kamal_backup/cli.rb', line 264
def self.basename
CLI.basename
end
|
Instance Method Details
#local(snapshot = "latest") ⇒ Object
269
270
271
272
|
# File 'lib/kamal_backup/cli.rb', line 269
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
276
277
278
279
280
281
282
283
284
|
# File 'lib/kamal_backup/cli.rb', line 276
def production(snapshot = "latest")
confirm_production_restore!(snapshot)
if deployment_mode?
exec_remote(["kamal-backup", "restore", "production", snapshot, "--confirm-production-restore"])
else
puts(JSON.pretty_generate(direct_app.restore_to_production(snapshot)))
end
end
|