Class: Hippo::Stage

Inherits:
Object
  • Object
show all
Defined in:
lib/hippo/stage.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Stage

Returns a new instance of Stage.



5
6
7
# File 'lib/hippo/stage.rb', line 5

def initialize(options)
  @options = options
end

Instance Method Details

#branchObject



13
14
15
# File 'lib/hippo/stage.rb', line 13

def branch
  @options['branch']
end

#kubectl(*command) ⇒ Object



30
31
32
# File 'lib/hippo/stage.rb', line 30

def kubectl(*command)
  "kubectl -n #{namespace} #{command.join(' ')}"
end

#nameObject



9
10
11
# File 'lib/hippo/stage.rb', line 9

def name
  @options['name']
end

#namespaceObject



17
18
19
# File 'lib/hippo/stage.rb', line 17

def namespace
  @options['namespace']
end

#template_varsObject



21
22
23
24
25
26
27
28
# File 'lib/hippo/stage.rb', line 21

def template_vars
  {
    'name' => name,
    'branch' => branch,
    'namespace' => namespace,
    'vars' => @options['vars'] || {}
  }
end