public static final class ShellStepProps.Builder
extends java.lang.Object
ShellStepProps
Constructor and Description |
---|
Builder() |
public ShellStepProps.Builder commands(java.util.List<java.lang.String> commands)
ShellStepProps.getCommands()
commands
- Commands to run. This parameter is required.this
public ShellStepProps.Builder additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
ShellStepProps.getAdditionalInputs()
additionalInputs
- Additional FileSets to put in other directories.
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();
this
public ShellStepProps.Builder env(java.util.Map<java.lang.String,java.lang.String> env)
ShellStepProps.getEnv()
env
- Environment variables to set.this
public ShellStepProps.Builder envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
ShellStepProps.getEnvFromCfnOutputs()
envFromCfnOutputs
- Set environment variables based on Stack Outputs.
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.this
public ShellStepProps.Builder input(IFileSetProducer input)
ShellStepProps.getInput()
input
- FileSet to run these scripts on.
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.this
public ShellStepProps.Builder installCommands(java.util.List<java.lang.String> installCommands)
ShellStepProps.getInstallCommands()
installCommands
- 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
.this
public ShellStepProps.Builder primaryOutputDirectory(java.lang.String primaryOutputDirectory)
ShellStepProps.getPrimaryOutputDirectory()
primaryOutputDirectory
- The directory that will contain the primary output fileset.
After running the script, the contents of the given directory
will be treated as the primary output of this Step.this
public ShellStepProps build()
ShellStepProps
java.lang.NullPointerException
- if any required attribute was not provided