Modifier and Type | Method and Description |
---|---|
ShellStep.Builder |
additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
Additional FileSets to put in other directories.
|
ShellStep |
build() |
ShellStep.Builder |
commands(java.util.List<java.lang.String> commands)
Commands to run.
|
static ShellStep.Builder |
create(java.lang.String id) |
ShellStep.Builder |
env(java.util.Map<java.lang.String,java.lang.String> env)
Environment variables to set.
|
ShellStep.Builder |
envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
Set environment variables based on Stack Outputs.
|
ShellStep.Builder |
input(IFileSetProducer input)
FileSet to run these scripts on.
|
ShellStep.Builder |
installCommands(java.util.List<java.lang.String> installCommands)
Installation commands to run before the regular commands.
|
ShellStep.Builder |
primaryOutputDirectory(java.lang.String primaryOutputDirectory)
The directory that will contain the primary output fileset.
|
public static ShellStep.Builder create(java.lang.String id)
id
- This parameter is required.ShellStep.Builder
.public ShellStep.Builder commands(java.util.List<java.lang.String> commands)
commands
- Commands to run. This parameter is required.this
public ShellStep.Builder additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
Specifies a mapping from directory name to FileSets. During the script execution, the FileSets will be available in the directories indicated.
The directory names may be relative. For example, you can put the main input and an additional input side-by-side with the following configuration:
ShellStep script = ShellStep.Builder.create("MainScript") .commands(List.of("npm ci", "npm run build", "npx cdk synth")) .input(CodePipelineSource.gitHub("org/source1", "main")) .additionalInputs(Map.of( "../siblingdir", CodePipelineSource.gitHub("org/source2", "main"))) .build();
Default: - No additional inputs
additionalInputs
- Additional FileSets to put in other directories. This parameter is required.this
public ShellStep.Builder env(java.util.Map<java.lang.String,java.lang.String> env)
Default: - No environment variables
env
- Environment variables to set. This parameter is required.this
public ShellStep.Builder envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
ShellStep
s following stack or stage deployments may
access the CfnOutput
s of those stacks to get access to
--for example--automatically generated resource names or
endpoint URLs.
Default: - No environment variables created from stack outputs
envFromCfnOutputs
- Set environment variables based on Stack Outputs. This parameter is required.this
public ShellStep.Builder input(IFileSetProducer input)
The files in the FileSet will be placed in the working directory when
the script is executed. Use additionalInputs
to download file sets
to other directories as well.
Default: - No input specified
input
- FileSet to run these scripts on. This parameter is required.this
public ShellStep.Builder installCommands(java.util.List<java.lang.String> installCommands)
For deployment engines that support it, install commands will be classified
differently in the job history from the regular commands
.
Default: - No installation commands
installCommands
- Installation commands to run before the regular commands. This parameter is required.this
public ShellStep.Builder primaryOutputDirectory(java.lang.String primaryOutputDirectory)
After running the script, the contents of the given directory will be treated as the primary output of this Step.
Default: - No primary output
primaryOutputDirectory
- The directory that will contain the primary output fileset. This parameter is required.this
public ShellStep build()