Sha256: 6c76a416920c61ef6f5a9f2bc9858f318e63985329a95314e7950478c5f61978

Contents?: true

Size: 855 Bytes

Versions: 3

Compression:

Stored size: 855 Bytes

Contents

# frozen_string_literal: true

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

      # Starts a specific workload in app.
      cpl ps:start -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.reverse_each do |workload|
        step("Starting workload '#{workload}'") do
          cp.workload_set_suspend(workload, false)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cpl-0.6.0 lib/command/ps_start.rb
cpl-0.5.1 lib/command/ps_start.rb
cpl-0.5.0 lib/command/ps_start.rb