aws-cdk-lib.pipelines.ShellStepProps

interface ShellStepProps

LanguageType name
.NETAmazon.CDK.Pipelines.ShellStepProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#ShellStepProps
Javasoftware.amazon.awscdk.pipelines.ShellStepProps
Pythonaws_cdk.pipelines.ShellStepProps
TypeScript (source)aws-cdk-lib » pipelines » ShellStepProps

Construction properties for a ShellStep.

Example

declare const codePipeline: codepipeline.Pipeline;

const sourceArtifact = new codepipeline.Artifact('MySourceArtifact');

const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
  codePipeline: codePipeline,
  synth: new pipelines.ShellStep('Synth', {
    input: pipelines.CodePipelineFileSet.fromArtifact(sourceArtifact),
    commands: ['npm ci','npm run build','npx cdk synth'],
  }),
});

Properties

NameTypeDescription
commandsstring[]Commands to run.
additionalInputs?{ [string]: IFileSetProducer }Additional FileSets to put in other directories.
env?{ [string]: string }Environment variables to set.
envFromCfnOutputs?{ [string]: CfnOutput }Set environment variables based on Stack Outputs.
input?IFileSetProducerFileSet to run these scripts on.
installCommands?string[]Installation commands to run before the regular commands.
primaryOutputDirectory?stringThe directory that will contain the primary output fileset.

commands

Type: string[]

Commands to run.


additionalInputs?

Type: { [string]: IFileSetProducer } (optional, default: No additional inputs)

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:

const script = new pipelines.ShellStep('MainScript', {
  commands: ['npm ci','npm run build','npx cdk synth'],
  input: pipelines.CodePipelineSource.gitHub('org/source1', 'main'),
  additionalInputs: {
    '../siblingdir': pipelines.CodePipelineSource.gitHub('org/source2', 'main'),
  }
});

env?

Type: { [string]: string } (optional, default: No environment variables)

Environment variables to set.


envFromCfnOutputs?

Type: { [string]: CfnOutput } (optional, default: No environment variables created from stack outputs)

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.


input?

Type: IFileSetProducer (optional, default: No input specified)

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.


installCommands?

Type: string[] (optional, default: No installation commands)

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.


primaryOutputDirectory?

Type: string (optional, default: No primary output)

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.