Class: Neetob::CLI::NeetoDeploy::Certificates
- Defined in:
- lib/neetob/cli/neeto_deploy/certificates.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(app) ⇒ Certificates
constructor
A new instance of Certificates.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(app) ⇒ Certificates
11 12 13 14 |
# File 'lib/neetob/cli/neeto_deploy/certificates.rb', line 11 def initialize(app) super() @app = app end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
9 10 11 |
# File 'lib/neetob/cli/neeto_deploy/certificates.rb', line 9 def app @app end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/neetob/cli/neeto_deploy/certificates.rb', line 16 def run certificates_command_result = `neetodeploy certificates list -a #{app}` parseable_result = certificates_command_result.strip.gsub("=>", ":") parsed_certificates_result = JSON.parse(parseable_result) return parsed_certificates_result if Thread.current[:audit_mode] if parsed_certificates_result.empty? ui.error("No certificates found for the app with name \"#{app}\".") else parsed_certificates_result.each do |certificate| if certificate["expires_before_30_days"] ui.error("Certificate #{certificate["name"]} is expiring in less than 30 days.") else ui.success("Certificate #{certificate["name"]} is valid for over 30 days in the future.") end end end end |