Sha256: 77fefdfb1a925ca822e5514ecde517d331f8615dd81ed6afd5c3111a20c4b0c9

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

class Jets::CLI
  class Maintenance < Jets::Thor::Base
    class_option :role, aliases: [:r], default: "web", desc: "Role to apply the maintenance mode to. IE: web worker"

    desc "on", "Turn on maintenance mode"
    long_desc Help.text("maintenance/on")
    yes_option
    def on
      Mode.new(options).on
    end

    # Note: --yes or -y is not used for the off command.
    # User will not be prompted for confirmation.
    # The option is allowed in case users accidentally use it.
    # Example:
    #   jets maintenance off -y
    # This is why the option is hidden. This makes the user experience better.
    desc "off", "Turn off maintenance mode"
    long_desc Help.text("maintenance/off")
    option :yes, aliases: [:y], type: :boolean, desc: "Skip are you sure prompt", hide: true
    def off
      Mode.new(options).off
    end

    desc "status", "Show maintenance mode status"
    long_desc Help.text("maintenance/status")
    option :all, aliases: [:a], type: :boolean, desc: "Show status for all roles. Takes precedence over --role option", default: false
    def status
      Mode.new(options).status
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/cli/maintenance.rb
jets-6.0.4 lib/jets/cli/maintenance.rb
jets-6.0.3 lib/jets/cli/maintenance.rb
jets-6.0.2 lib/jets/cli/maintenance.rb