Class: Fauxpaas::CLI::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/fauxpaas/cli/main.rb

Overview

Main commands of the cli

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Main

Returns a new instance of Main.



14
15
16
17
18
# File 'lib/fauxpaas/cli/main.rb', line 14

def initialize(*args)
  super(*args)
  @opts = setup
  @invoker = Fauxpaas.invoker
end

Instance Method Details

#caches(instance_name) ⇒ Object



55
56
57
# File 'lib/fauxpaas/cli/main.rb', line 55

def caches(instance_name)
  invoker.add_command(CachesCommand.new(opts))
end

#default_branch(instance_name, new_branch = nil) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/fauxpaas/cli/main.rb', line 37

def default_branch(instance_name, new_branch = nil)
  command = if new_branch
    SetDefaultBranchCommand.new(opts.merge({new_branch: new_branch}))
  else
    ReadDefaultBranchCommand.new(opts)
  end
  invoker.add_command(command)
end

#deploy(instance_name, reference = nil) ⇒ Object



31
32
33
# File 'lib/fauxpaas/cli/main.rb', line 31

def deploy(instance_name, reference = nil)
  invoker.add_command(DeployCommand.new(opts.merge(reference: reference)))
end

#releases(instance_name) ⇒ Object



61
62
63
# File 'lib/fauxpaas/cli/main.rb', line 61

def releases(instance_name)
  invoker.add_command(ReleasesCommand.new(opts))
end

#restart(instance_name) ⇒ Object



67
68
69
# File 'lib/fauxpaas/cli/main.rb', line 67

def restart(instance_name)
  invoker.add_command(RestartCommand.new(opts))
end

#rollback(instance_name, cache = "") ⇒ Object



49
50
51
# File 'lib/fauxpaas/cli/main.rb', line 49

def rollback(instance_name, cache = "")
  invoker.add_command(RollbackCommand.new(opts.merge({cache: cache})))
end