Class: Kaiser::Cmds::DbSave
Instance Method Summary
collapse
Methods inherited from Kaiser::Cli
all_subcommands_usage, #define_options, register, run_command, #set_config, #start_services, #stop_app, #stop_services
#option, #options
Instance Method Details
#execute(_opts) ⇒ Object
19
20
21
22
23
|
# File 'lib/kaiser/cmds/db_save.rb', line 19
def execute(_opts)
ensure_setup
name = ARGV.shift || '.default'
save_db(name)
end
|
#usage ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/kaiser/cmds/db_save.rb', line 6
def usage
<<~EOS
Shuts down the database docker container, backs up the database and brings the container back up.
The database will be saved as a tarball to \`~/.kaiser/<ENV_NAME>/<current_github_branch_name>/<DB_BACKUP_FILENAME>.tar.bz\`
Alternatively you can also save it to your current directory.
USAGE: kaiser db_save DB_BACKUP_FILENAME
kaiser db_save ./my_database.tar.bz
EOS
end
|