Class ShellStepProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • commands

      @Stability(Stable) public ShellStepProps.Builder commands(List<String> commands)
      Parameters:
      commands - Commands to run. This parameter is required.
      Returns:
      this
    • additionalInputs

      @Stability(Stable) public ShellStepProps.Builder additionalInputs(Map<String,? extends IFileSetProducer> additionalInputs)
      Parameters:
      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();
                               
      Returns:
      this
    • env

      @Stability(Stable) public ShellStepProps.Builder env(Map<String,String> env)
      Sets the value of ShellStepProps.getEnv()
      Parameters:
      env - Environment variables to set.
      Returns:
      this
    • envFromCfnOutputs

      @Stability(Stable) public ShellStepProps.Builder envFromCfnOutputs(Map<String,? extends CfnOutput> envFromCfnOutputs)
      Parameters:
      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.
      Returns:
      this
    • input

      @Stability(Stable) public ShellStepProps.Builder input(IFileSetProducer input)
      Sets the value of ShellStepProps.getInput()
      Parameters:
      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.
      Returns:
      this
    • installCommands

      @Stability(Stable) public ShellStepProps.Builder installCommands(List<String> installCommands)
      Parameters:
      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.
      Returns:
      this
    • primaryOutputDirectory

      @Stability(Stable) public ShellStepProps.Builder primaryOutputDirectory(String primaryOutputDirectory)
      Parameters:
      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.
      Returns:
      this
    • build

      @Stability(Stable) public ShellStepProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<ShellStepProps>
      Returns:
      a new instance of ShellStepProps
      Throws:
      NullPointerException - if any required attribute was not provided