Sha256: 40542493184e8172d7a744d67736c01e636c4f1a5558785d3f5dbaf13747f72b

Contents?: true

Size: 1020 Bytes

Versions: 2

Compression:

Stored size: 1020 Bytes

Contents

# frozen_string_literal: true

module Command
  class Maintenance < Base
    NAME = "maintenance"
    OPTIONS = [
      app_option(required: true),
      domain_option
    ].freeze
    DESCRIPTION = "Checks if maintenance mode is on or off for an app"
    LONG_DESCRIPTION = <<~DESC
      - Checks if maintenance mode is on or off for an app
      - Outputs 'on' or 'off'
      - Specify the one-off workload through `one_off_workload` in the `.controlplane/controlplane.yml` file
      - Optionally specify the maintenance workload through `maintenance_workload` in the `.controlplane/controlplane.yml` file (defaults to 'maintenance')
      - Maintenance mode is only supported for domains that use path based routing mode and have a route configured for the prefix '/' on either port 80 or 443
    DESC
    WITH_INFO_HEADER = false

    def call
      puts maintenance_mode.enabled? ? "on" : "off"
    end

    private

    def maintenance_mode
      @maintenance_mode ||= MaintenanceMode.new(self)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cpflow-4.0.1 lib/command/maintenance.rb
cpflow-4.0.0 lib/command/maintenance.rb