Sha256: 807cae86f7ceb0276ad3a8c8d1c1ea0ffdf91e70fa07ef2b5ab74b14d75add16

Contents?: true

Size: 1.5 KB

Versions: 30

Compression:

Stored size: 1.5 KB

Contents

require 'ey-core/cli/subcommand'

module Ey
  module Core
    module Cli
      module Web
        class Enable < Ey::Core::Cli::Subcommand
          title "enable"
          summary "Remove the maintenance page for this application in the given environment."

          option :app,
            short: "a",
            long: "app",
            description: "Name or id of the application whose maintenance page will be removed",
            argument: "app"

          option :environment,
            short: "e",
            long: "environment",
            description: "Name or id of the environment to deploy to.",
            argument: "Environment"

          option :account,
            short: 'c',
            long: 'account',
            description: 'Name or ID of the account that the environment resides in.',
            argument: 'account'

          def handle
            operator, environment = core_operator_and_environment_for(self.options)
            application           = core_application_for(environment, options)
            puts "Disabling maintenance for #{application.name} on #{environment.name}".green
            request = environment.maintenance(application, "disable")
            request.wait_for { |r| r.ready? }
            if request.successful
              puts "Successfully disabled maintenance page".green
            else
              puts "Disabling maintenance mode was not successful".red
              ap request
            end
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/cli/web/enable.rb
ey-core-3.6.4 lib/ey-core/cli/web/enable.rb
ey-core-3.6.3 lib/ey-core/cli/web/enable.rb
ey-core-3.6.1 lib/ey-core/cli/web/enable.rb
groove-ey-core-3.6.3 lib/ey-core/cli/web/enable.rb
groove-ey-core-3.6.2 lib/ey-core/cli/web/enable.rb
groove-ey-core-3.6.1 lib/ey-core/cli/web/enable.rb
ey-core-3.5.0 lib/ey-core/cli/web/enable.rb
ey-core-3.4.4 lib/ey-core/cli/web/enable.rb
ey-core-3.4.2 lib/ey-core/cli/web/enable.rb
ey-core-3.4.1 lib/ey-core/cli/web/enable.rb
ey-core-3.4.0 lib/ey-core/cli/web/enable.rb
ey-core-3.3.1 lib/ey-core/cli/web/enable.rb
ey-core-3.3.0 lib/ey-core/cli/web/enable.rb
ey-core-3.2.6 lib/ey-core/cli/web/enable.rb
ey-core-3.2.5 lib/ey-core/cli/web/enable.rb
ey-core-3.2.4 lib/ey-core/cli/web/enable.rb
ey-core-3.2.3 lib/ey-core/cli/web/enable.rb
ey-core-3.2.2 lib/ey-core/cli/web/enable.rb
ey-core-3.2.1 lib/ey-core/cli/web/enable.rb