Sha256: 674b191d37eeee8edf35377e6b098778852ea75879d68dcfbba98101385cd525

Contents?: true

Size: 850 Bytes

Versions: 8

Compression:

Stored size: 850 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 = <<~HEREDOC
      - Starts workloads in app
    HEREDOC
    EXAMPLES = <<~HEREDOC
      ```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
      ```
    HEREDOC

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

      workloads.reverse_each do |workload|
        cp.workload_set_suspend(workload, false)
        progress.puts "#{workload} started"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cpl-0.4.1 lib/command/ps_start.rb
cpl-0.4.0 lib/command/ps_start.rb
cpl-0.3.3 lib/command/ps_start.rb
cpl-0.3.2 lib/command/ps_start.rb
cpl-0.3.1 lib/command/ps_start.rb
cpl-0.3.0 lib/command/ps_start.rb
cpl-0.2.0 lib/command/ps_start.rb
cpl-0.1.0 lib/command/ps_start.rb