Class: Rmd::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/rmd/cli.rb

Constant Summary collapse

CONFIG_PATH =
'./creds.yml'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load_configObject



13
14
15
16
17
# File 'lib/rmd/cli.rb', line 13

def load_config
  fail(FileNotFound, 'Creds file not found. Ask DucLe for it') unless File.file?(CONFIG_PATH)
  config = YAML.load_file(File.expand_path(CONFIG_PATH))
  Configure.set(config)
end

Instance Method Details

#deployObject



22
23
24
25
26
27
# File 'lib/rmd/cli.rb', line 22

def deploy
  Cli.load_config
  DeployService.deploy(options[:server])
rescue Exception => e
  $stdout.puts(e.message)
end

#restartObject



31
32
33
34
35
36
# File 'lib/rmd/cli.rb', line 31

def restart
  Cli.load_config
  DeployService.restart(options[:server])
rescue Exception => e
  $stdout.puts(e.message)
end