Run shell script commands in the pipeline.
Implements
Inherited Members
Namespace: Amazon.CDK.Pipelines
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ShellStep : Step, IFileSetProducer
Syntax (vb)
Public Class ShellStep Inherits Step Implements IFileSetProducer
Examples
CodePipeline pipeline;
var preprod = new MyApplicationStage(this, "PreProd");
var prod = new MyApplicationStage(this, "Prod");
var topic = new Topic(this, "ChangeApprovalTopic");
pipeline.AddStage(preprod, new AddStageOpts {
Post = new [] {
new ShellStep("Validate Endpoint", new ShellStepProps {
Commands = new [] { "curl -Ssf https://my.webservice.com/" }
}) }
});
pipeline.AddStage(prod, new AddStageOpts {
Pre = new [] { new ManualApprovalStep("PromoteToProd", new ManualApprovalStepProps {
//All options below are optional
Comment = "Please validate changes",
ReviewUrl = "https://my.webservice.com/",
NotificationTopic = topic
}) }
});
Synopsis
Constructors
Properties
| Commands | Commands to run. |
| ConsumedStackOutputs | StackOutputReferences this step consumes. |
| Env | Environment variables to set. |
| EnvFromCfnOutputs | Set environment variables based on Stack Outputs. |
| Inputs | Input FileSets. |
| InstallCommands | Installation commands to run before the regular commands. |
| Outputs | Output FileSets. |
Methods
Constructors
ShellStep(string, IShellStepProps)
Run shell script commands in the pipeline.
public ShellStep(string id, IShellStepProps props)
Parameters
- id string
Identifier for this step.
- props IShellStepProps
Identifier for this step.
Properties
Commands
ConsumedStackOutputs
StackOutputReferences this step consumes.
public override StackOutputReference[] ConsumedStackOutputs { get; }
Property Value
Overrides
Env
Environment variables to set.
public virtual IDictionary<string, string> Env { get; }
Property Value
EnvFromCfnOutputs
Set environment variables based on Stack Outputs.
public virtual IDictionary<string, StackOutputReference> EnvFromCfnOutputs { get; }
Property Value
Inputs
InstallCommands
Installation commands to run before the regular commands.
public virtual string[] InstallCommands { get; }
Property Value
string[]
Remarks
Outputs
Output FileSets.
public virtual IFileSetLocation[] Outputs { get; }
Property Value
Methods
AddOutputDirectory(string)
Add an additional output FileSet based on a directory.
public virtual FileSet AddOutputDirectory(string directory)
Parameters
- directory string
Returns
PrimaryOutputDirectory(string)
Configure the given output directory as primary output.
public virtual FileSet PrimaryOutputDirectory(string directory)
Parameters
- directory string