Class: Heighliner::Cmds::DbLoad

Inherits:
Heighliner::Cli show all
Defined in:
lib/heighliner/cmds/db_load.rb

Instance Attribute Summary

Attributes inherited from Heighliner::Cli

#use_steerfile

Instance Method Summary collapse

Methods inherited from Heighliner::Cli

all_subcommands_usage, #define_options, #initialize, register, run_command, #set_config, #start_services, #stop_app, #stop_services

Methods included from Heighliner::CliOptions

#option, #options

Constructor Details

This class inherits a constructor from Heighliner::Cli

Instance Method Details

#execute(_opts) ⇒ Object



22
23
24
25
26
# File 'lib/heighliner/cmds/db_load.rb', line 22

def execute(_opts)
  ensure_setup
  name = ARGV.shift || 'default'
  load_db(name)
end

#usageObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/heighliner/cmds/db_load.rb', line 6

def usage
  <<~EOS
    Shuts down the database docker container, *replaces* the database with the backup provided and brings the container up again.

    The database will be restored from a tarball saved as \`~/.heighliner/<ENV_NAME>/<current_github_branch_name>/<DB_BACKUP_FILENAME>.tar.bz\`

    Alternatively you can also load it from your current directory.

    If no database name was provided, the default database stored at \`~/.heighliner/<ENV_NAME>/<current_github_branch_name>/default.tar.bz\` will be used.

    USAGE: heighliner db_load
           heighliner db_load DB_BACKUP_FILENAME
           heighliner db_load ./my_database.tar.bz
  EOS
end