@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-20T22:20:07.447Z") public class ShellStep extends Step
This is a generic step designed to be deployment engine agnostic.
Example:
// Modern API CodePipeline modernPipeline = CodePipeline.Builder.create(this, "Pipeline") .selfMutation(false) .synth(ShellStep.Builder.create("Synth") .input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder() .connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41") .build())) .commands(List.of("npm ci", "npm run build", "npx cdk synth")) .build()) .build(); // Original API Artifact cloudAssemblyArtifact = new Artifact(); CdkPipeline originalPipeline = CdkPipeline.Builder.create(this, "Pipeline") .selfMutating(false) .cloudAssemblyArtifact(cloudAssemblyArtifact) .build();
Modifier and Type | Class and Description |
---|---|
static class |
ShellStep.Builder
A fluent builder for
ShellStep . |
IFileSetProducer.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
ShellStep(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ShellStep(software.amazon.jsii.JsiiObjectRef objRef) |
|
ShellStep(java.lang.String id,
ShellStepProps props) |
Modifier and Type | Method and Description |
---|---|
FileSet |
addOutputDirectory(java.lang.String directory)
Add an additional output FileSet based on a directory.
|
java.util.List<java.lang.String> |
getCommands()
Commands to run.
|
java.util.Map<java.lang.String,java.lang.String> |
getEnv()
Environment variables to set.
|
java.util.Map<java.lang.String,StackOutputReference> |
getEnvFromCfnOutputs()
Set environment variables based on Stack Outputs.
|
java.util.List<FileSetLocation> |
getInputs()
Input FileSets.
|
java.util.List<java.lang.String> |
getInstallCommands()
Installation commands to run before the regular commands.
|
java.util.List<FileSetLocation> |
getOutputs()
Output FileSets.
|
FileSet |
primaryOutputDirectory(java.lang.String directory)
Configure the given output directory as primary output.
|
addDependencyFileSet, addStepDependency, configurePrimaryOutput, discoverReferencedOutputs, getDependencies, getDependencyFileSets, getId, getIsSource, getPrimaryOutput, sequence, toString
protected ShellStep(software.amazon.jsii.JsiiObjectRef objRef)
protected ShellStep(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public ShellStep(java.lang.String id, ShellStepProps props)
id
- This parameter is required.props
- This parameter is required.public FileSet addOutputDirectory(java.lang.String 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.
directory
- This parameter is required.public FileSet primaryOutputDirectory(java.lang.String directory)
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.
directory
- This parameter is required.public java.util.List<java.lang.String> getCommands()
public java.util.Map<java.lang.String,java.lang.String> getEnv()
Default: - No environment variables
public java.util.Map<java.lang.String,StackOutputReference> getEnvFromCfnOutputs()
Default: - No environment variables created from stack outputs
public java.util.List<FileSetLocation> getInputs()
A list of (FileSet, directory)
pairs, which are a copy of the
input properties. This list should not be modified directly.
public java.util.List<java.lang.String> getInstallCommands()
For deployment engines that support it, install commands will be classified
differently in the job history from the regular commands
.
Default: - No installation commands
public java.util.List<FileSetLocation> getOutputs()
A list of (FileSet, directory)
pairs, which are a copy of the
input properties. This list should not be modified directly.