Class: AWSCDK::CodePipelineActions::CommandsActionProps

Inherits:
AWSCDK::Codepipeline::CommonAWSActionProps
  • Object
show all
Defined in:
code_pipeline_actions/commands_action_props.rb

Overview

Construction properties of the CommandsAction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, commands:, input:, extra_inputs: nil, output: nil, output_variables: nil) ⇒ CommandsActionProps

Returns a new instance of CommandsActionProps.

Parameters:

  • action_name (String)

    The physical, human-readable name of the Action.

  • run_order (Numeric, nil) (defaults to: nil)

    The runOrder property for this Action.

  • variables_namespace (String, nil) (defaults to: nil)

    The name of the namespace to use for variables emitted by this action.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The Role in which context's this Action will be executing in.

  • commands (Array<String>)

    Shell commands for the Commands action to run.

  • input (AWSCDK::Codepipeline::Artifact)

    The source to use as input for this action.

  • extra_inputs (Array<AWSCDK::Codepipeline::Artifact>, nil) (defaults to: nil)

    The list of additional input artifacts for this action.

  • output (AWSCDK::Codepipeline::Artifact, nil) (defaults to: nil)

    The output artifact for this action.

  • output_variables (Array<String>, nil) (defaults to: nil)

    The names of the variables in your environment that you want to export.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'code_pipeline_actions/commands_action_props.rb', line 16

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, commands:, input:, extra_inputs: nil, output: nil, output_variables: nil)
  @action_name = action_name
  Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName")
  @run_order = run_order
  Jsii::Type.check_type(@run_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "runOrder") unless @run_order.nil?
  @variables_namespace = variables_namespace
  Jsii::Type.check_type(@variables_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variablesNamespace") unless @variables_namespace.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @commands = commands
  Jsii::Type.check_type(@commands, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "commands")
  @input = input
  Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "input")
  @extra_inputs = extra_inputs
  Jsii::Type.check_type(@extra_inputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmUuQXJ0aWZhY3QifSwia2luZCI6ImFycmF5In19")), "extraInputs") unless @extra_inputs.nil?
  @output = output
  Jsii::Type.check_type(@output, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "output") unless @output.nil?
  @output_variables = output_variables
  Jsii::Type.check_type(@output_variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "outputVariables") unless @output_variables.nil?
end

Instance Attribute Details

#action_nameString (readonly)

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.

Returns:

  • (String)


42
43
44
# File 'code_pipeline_actions/commands_action_props.rb', line 42

def action_name
  @action_name
end

#commandsArray<String> (readonly)

Shell commands for the Commands action to run.

All formats are supported except multi-line formats.

The length of the commands array must be between 1 and 50.

Returns:

  • (Array<String>)


74
75
76
# File 'code_pipeline_actions/commands_action_props.rb', line 74

def commands
  @commands
end

#extra_inputsArray<AWSCDK::Codepipeline::Artifact>? (readonly)

Note:

Default: - no extra inputs

The list of additional input artifacts for this action.

Returns:



83
84
85
# File 'code_pipeline_actions/commands_action_props.rb', line 83

def extra_inputs
  @extra_inputs
end

#inputAWSCDK::Codepipeline::Artifact (readonly)

The source to use as input for this action.



78
79
80
# File 'code_pipeline_actions/commands_action_props.rb', line 78

def input
  @input
end

#outputAWSCDK::Codepipeline::Artifact? (readonly)

Note:

Default: - no output artifact

The output artifact for this action.

You can filter files that you want to export as the output artifact for the action.

Examples:

AWSCDK::Codepipeline::Artifact.new("CommandsArtifact", ["my-dir/**"])

Returns:



92
93
94
# File 'code_pipeline_actions/commands_action_props.rb', line 92

def output
  @output
end

#output_variablesArray<String>? (readonly)

Note:

Default: - No output variables are exported

The names of the variables in your environment that you want to export.

These variables can be referenced in other actions by using the variable method of this class.



101
102
103
# File 'code_pipeline_actions/commands_action_props.rb', line 101

def output_variables
  @output_variables
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: a new Role will be generated

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.

Returns:



66
67
68
# File 'code_pipeline_actions/commands_action_props.rb', line 66

def role
  @role
end

#run_orderNumeric? (readonly)

Note:

Default: 1

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.



50
51
52
# File 'code_pipeline_actions/commands_action_props.rb', line 50

def run_order
  @run_order
end

#variables_namespaceString? (readonly)

Note:

Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

The name of the namespace to use for variables emitted by this action.

Returns:

  • (String, nil)


55
56
57
# File 'code_pipeline_actions/commands_action_props.rb', line 55

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'code_pipeline_actions/commands_action_props.rb', line 103

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :commands => "commands",
    :input => "input",
    :extra_inputs => "extraInputs",
    :output => "output",
    :output_variables => "outputVariables",
  }
end

Instance Method Details

#to_jsiiObject



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'code_pipeline_actions/commands_action_props.rb', line 117

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "commands" => @commands,
    "input" => @input,
    "extraInputs" => @extra_inputs,
    "output" => @output,
    "outputVariables" => @output_variables,
  })
  result.compact
end