Class: Heighliner::Cmds::DbResetHard

Inherits:
Heighliner::Cli show all
Defined in:
lib/heighliner/cmds/db_reset_hard.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



14
15
16
17
18
# File 'lib/heighliner/cmds/db_reset_hard.rb', line 14

def execute(_opts)
  ensure_setup
  FileUtils.rm db_image_path('default') if File.exist?(db_image_path('default'))
  setup_db
end

#usageObject



6
7
8
9
10
11
12
# File 'lib/heighliner/cmds/db_reset_hard.rb', line 6

def usage
  <<~EOS
    Shuts down the database docker container, deletes the default database image stored at \`~/.heighliner/<ENV_NAME>/<current_github_branch_name>/default.tar.bz\`, rebuilds the docker volume if needed and the default database image from scratch and then brings the container up again.

    USAGE: heighliner db_reset_hard
  EOS
end