Sha256: 5f0e276df0c36969aafbf2a78578725e6b66cde47acee99997d7e87b40e0bfac

Contents?: true

Size: 945 Bytes

Versions: 20

Compression:

Stored size: 945 Bytes

Contents

# frozen_string_literal: true

module Command
  class PsRestart < Base
    NAME = "ps:restart"
    OPTIONS = [
      app_option(required: true),
      workload_option
    ].freeze
    DESCRIPTION = "Forces redeploy of workloads in app"
    LONG_DESCRIPTION = <<~DESC
      - Forces redeploy of workloads in app
    DESC
    EXAMPLES = <<~EX
      ```sh
      # Forces redeploy of all workloads in app.
      cpl ps:restart -a $APP_NAME

      # Forces redeploy of a specific workload in app.
      cpl ps:restart -a $APP_NAME -w $WORKLOAD_NAME
      ```
    EX

    def call
      workloads = [config.options[:workload]] if config.options[:workload]
      workloads ||= config[:app_workloads] + config[:additional_workloads]

      workloads.each do |workload|
        step("Restarting workload '#{workload}'") do
          cp.fetch_workload!(workload)

          cp.workload_force_redeployment(workload)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cpl-2.2.4 lib/command/ps_restart.rb
cpl-2.2.2 lib/command/ps_restart.rb
cpl-2.2.1 lib/command/ps_restart.rb
cpl-2.2.0 lib/command/ps_restart.rb
cpl-1.4.0 lib/command/ps_restart.rb
cpl-1.3.0 lib/command/ps_restart.rb
cpl-1.2.0 lib/command/ps_restart.rb
cpl-1.1.2 lib/command/ps_restart.rb
cpl-1.1.2.rc.0 lib/command/ps_restart.rb
cpl-1.1.1 lib/command/ps_restart.rb
cpl-1.1.0 lib/command/ps_restart.rb
cpl-1.0.4 lib/command/ps_restart.rb
cpl-1.0.3 lib/command/ps_restart.rb
cpl-1.0.2 lib/command/ps_restart.rb
cpl-1.0.1 lib/command/ps_restart.rb
cpl-1.0.0 lib/command/ps_restart.rb
cpl-0.7.0 lib/command/ps_restart.rb
cpl-0.6.0 lib/command/ps_restart.rb
cpl-0.5.1 lib/command/ps_restart.rb
cpl-0.5.0 lib/command/ps_restart.rb