Class: Neetob::CLI::Sre::Report

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/sre/report.rb

Constant Summary

Constants inherited from Base

Base::APPS_LIST, Base::RESOURCES

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(environment) ⇒ Report

Returns a new instance of Report.



11
12
13
14
# File 'lib/neetob/cli/sre/report.rb', line 11

def initialize(environment)
  super()
  @environment = environment
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



9
10
11
# File 'lib/neetob/cli/sre/report.rb', line 9

def environment
  @environment
end

Instance Method Details

#runObject

Raises:

  • (StandardError)


16
17
18
19
20
21
22
23
24
25
26
# File 'lib/neetob/cli/sre/report.rb', line 16

def run
  raise(StandardError, "Environment should be staging or production.") unless environments.include?(environment)

  RESOURCES.each do |product, values|
    next if environment == "staging" && [:NeetoDeploy, :NeetoCi].include?(product)

    ui.info "Processing for #{product}"
    ui.info `neetob sre checklist -a #{product} -e #{environment}`
    ui.info "\n\n"
  end
end