All Implemented Interfaces:
IFileSetProducer
, software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
CodeBuildStep
@Generated (value ="jsii-pacmak/1.104.0 (build e79254c)",
date ="2024-11-15T10:25:08.918Z")
@Stability(Stable)
public class ShellStep
extends Step
Run shell script commands in the pipeline.
This is a generic step designed
to be deployment engine agnostic.
Example:
Pipeline codePipeline;
Artifact sourceArtifact = new Artifact("MySourceArtifact");
CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
.codePipeline(codePipeline)
.synth(ShellStep.Builder.create("Synth")
.input(CodePipelineFileSet.fromArtifact(sourceArtifact))
.commands(List.of("npm ci", "npm run build", "npx cdk synth"))
.build())
.build();
Nested Class Summary
Nested Classes
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Constructor Summary
Constructors
protected
ShellStep (software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
ShellStep (software.amazon.jsii.JsiiObjectRef objRef)
Method Summary
All Methods Instance Methods Concrete Methods
Add an additional output FileSet based on a directory.
StackOutputReferences this step consumes.
Environment variables to set.
Set environment variables based on Stack Outputs.
Installation commands to run before the regular commands.
Configure the given output directory as primary output.
Methods inherited from class software.amazon.awscdk.pipelines.Step
addDependencyFileSet , addStepDependency , configurePrimaryOutput , discoverReferencedOutputs , getDependencies , getDependencyFileSets , getId , getIsSource , getPrimaryOutput , sequence , toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Constructor Details
ShellStep
protected ShellStep (software.amazon.jsii.JsiiObjectRef objRef)
ShellStep
protected ShellStep (software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
ShellStep
Parameters:
id
- Identifier for this step. This parameter is required.
props
- This parameter is required.
Method Details
addOutputDirectory
@Stability(Stable)
@NotNull
public FileSet addOutputDirectory (@NotNull
String directory)
Add an additional output FileSet based on a directory.
After running the script, the contents of the given directory
will be exported as a FileSet
. Use the FileSet
as the
input to another step.
Multiple calls with the exact same directory name string (not normalized)
will return the same FileSet.
Parameters:
directory
- This parameter is required.
primaryOutputDirectory
@Stability(Stable)
@NotNull
public FileSet primaryOutputDirectory (@NotNull
String directory)
Configure the given output directory as primary output.
If no primary output has been configured yet, this directory
will become the primary output of this ShellStep, otherwise this
method will throw if the given directory is different than the
currently configured primary output directory.
Parameters:
directory
- This parameter is required.
getCommands
@Stability(Stable)
@NotNull
public List <String > getCommands ()
Commands to run.
getEnv
Environment variables to set.
Default: - No environment variables
getEnvFromCfnOutputs
Set environment variables based on Stack Outputs.
Default: - No environment variables created from stack outputs
getInstallCommands
@Stability(Stable)
@NotNull
public List <String > getInstallCommands ()
Installation commands to run before the regular commands.
For deployment engines that support it, install commands will be classified
differently in the job history from the regular commands
.
Default: - No installation commands
getOutputs
Output FileSets.
A list of (FileSet, directory)
pairs, which are a copy of the
input properties. This list should not be modified directly.