Class ShellStep.Builder

java.lang.Object
software.amazon.awscdk.pipelines.ShellStep.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ShellStep>
Enclosing class:
ShellStep

@Stability(Stable) public static final class ShellStep.Builder extends Object implements software.amazon.jsii.Builder<ShellStep>
A fluent builder for ShellStep.
  • Method Details

    • create

      @Stability(Stable) public static ShellStep.Builder create(String id)
      Parameters:
      id - This parameter is required.
      Returns:
      a new instance of ShellStep.Builder.
    • commands

      @Stability(Stable) public ShellStep.Builder commands(List<String> commands)
      Commands to run.

      Parameters:
      commands - Commands to run. This parameter is required.
      Returns:
      this
    • additionalInputs

      @Stability(Stable) public ShellStep.Builder additionalInputs(Map<String,? extends IFileSetProducer> 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();
       

      Default: - No additional inputs

      Parameters:
      additionalInputs - Additional FileSets to put in other directories. This parameter is required.
      Returns:
      this
    • env

      @Stability(Stable) public ShellStep.Builder env(Map<String,String> env)
      Environment variables to set.

      Default: - No environment variables

      Parameters:
      env - Environment variables to set. This parameter is required.
      Returns:
      this
    • envFromCfnOutputs

      @Stability(Stable) public ShellStep.Builder envFromCfnOutputs(Map<String,? extends CfnOutput> envFromCfnOutputs)
      Set environment variables based on Stack Outputs.

      ShellSteps following stack or stage deployments may access the CfnOutputs of those stacks to get access to --for example--automatically generated resource names or endpoint URLs.

      Default: - No environment variables created from stack outputs

      Parameters:
      envFromCfnOutputs - Set environment variables based on Stack Outputs. This parameter is required.
      Returns:
      this
    • input

      @Stability(Stable) public ShellStep.Builder input(IFileSetProducer 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.

      Default: - No input specified

      Parameters:
      input - FileSet to run these scripts on. This parameter is required.
      Returns:
      this
    • installCommands

      @Stability(Stable) public ShellStep.Builder installCommands(List<String> 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.

      Default: - No installation commands

      Parameters:
      installCommands - Installation commands to run before the regular commands. This parameter is required.
      Returns:
      this
    • primaryOutputDirectory

      @Stability(Stable) public ShellStep.Builder primaryOutputDirectory(String 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.

      Default: - No primary output

      Parameters:
      primaryOutputDirectory - The directory that will contain the primary output fileset. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public ShellStep build()
      Specified by:
      build in interface software.amazon.jsii.Builder<ShellStep>
      Returns:
      a newly built instance of ShellStep.