module Commands::Destroy

Public Instance Methods

destroy( app_id = Services::AppConfig.get_or_exit('app'), environment_name = Services::AppConfig.get('environment') ) click to toggle source
# File lib/busbar_cli/commands/destroy.rb, line 10
def destroy(
  app_id = Services::AppConfig.get_or_exit('app'),
  environment_name = Services::AppConfig.get('environment')
)
  Services::Kube.configure_temporary_profile(options.profile)

  if environment_name.nil?
    Services::AppDestroyer.call(
      App.new(id: app_id)
    )
  else
    Services::EnvironmentDestroyer.call(
      Environment.new(app_id: app_id, name: environment_name)
    )
  end
end