Class: Neetob::CLI::Sre::CheckEssentialEnv

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

Constant Summary collapse

REQUIRED_KEYS =
[
  "RAILS_ENV",
  "RAILS_LOG_TO_STDOUT",
  "RACK_ENV",
  "RAILS_SERVE_STATIC_FILES",
  "HONEYBADGER_API_KEY",
  "HONEYBADGER_JS_API_KEY",
  "NODE_MODULES_CACHE",
  "YARN_CACHE",
  "YARN_PRODUCTION"
]
REQUIRED_KEYS_HEROKU =
[
  "HEROKU_APP_NAME"
]
REQUIRED_KEYS_NEETODEPLOY =
[
  "NEETODEPLOY_APP_NAME"
]

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(app = nil) ⇒ CheckEssentialEnv

Returns a new instance of CheckEssentialEnv.



28
29
30
31
# File 'lib/neetob/cli/sre/check_essential_env.rb', line 28

def initialize(app = nil)
  super()
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



26
27
28
# File 'lib/neetob/cli/sre/check_essential_env.rb', line 26

def app
  @app
end

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/neetob/cli/sre/check_essential_env.rb', line 33

def run
  if app.nil?
    APPS_LIST[:heroku].each do |app|
      check_envs_heroku(app)
    end
    APPS_LIST[:neetodeploy].each do |app|
      check_envs_neetodeploy(app)
    end
  else
    is_heroku(app) ? check_envs_heroku(app) : check_envs_neetodeploy(app)
  end
end