Skip to content
v2.275.0

ShellStepProps Struct ​

Construction properties for a ShellStep.

Example ​

ts
declare const pipeline: pipelines.CodePipeline;
const preprod = new MyApplicationStage(this, 'PreProd');
const prod = new MyApplicationStage(this, 'Prod');
const topic = new sns.Topic(this, 'ChangeApprovalTopic');

pipeline.addStage(preprod, {
  post: [
    new pipelines.ShellStep('Validate Endpoint', {
      commands: ['curl -Ssf https://my.webservice.com/'],
    }),
  ],
});
pipeline.addStage(prod, {
  pre: [new pipelines.ManualApprovalStep('PromoteToProd', {
    //All options below are optional
    comment: 'Please validate changes',
    reviewUrl: 'https://my.webservice.com/',
    notificationTopic: topic,
  })],
});

Properties ​

additionalInputsoptional{ [key: string]: IFileSetProducer }additional_inputsoptionaltyping.Mapping[str, IFileSetProducer]additionalInputsoptionalMap<String, IFileSetProducer>AdditionalInputsoptionalIDictionary<string, IFileSetProducer>AdditionalInputsoptional*map[string]IFileSetProducer#
Additional FileSets to put in other directories.

Default: No additional inputs

notes

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:

ts
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'),
  }
});
commandsstring[]commandstyping.List[str]commandsList<String>Commandsstring[]Commands*[]*stringrequired#
Commands to run.
envoptional{ [key: string]: string }envoptionaltyping.Mapping[str, str]envoptionalMap<String, String>EnvoptionalIDictionary<string, string>Envoptional*map[string]*string#
Environment variables to set.

Default: No environment variables

envFromCfnOutputsoptional{ [key: string]: CfnOutput }env_from_cfn_outputsoptionaltyping.Mapping[str, CfnOutput]envFromCfnOutputsoptionalMap<String, CfnOutput>EnvFromCfnOutputsoptionalIDictionary<string, CfnOutput>EnvFromCfnOutputsoptional*map[string]CfnOutput#
Set environment variables based on Stack Outputs.

Default: No environment variables created from 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.

inputoptionalIFileSetProducerinputoptionalIFileSetProducerinputoptionalIFileSetProducerInputoptionalIFileSetProducerInputoptionalIFileSetProducer#
FileSet to run these scripts on.

Default: No input specified

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.

installCommandsoptionalstring[]install_commandsoptionaltyping.List[str]installCommandsoptionalList<String>InstallCommandsoptionalstring[]InstallCommandsoptional*[]*string#
Installation commands to run before the regular commands.

Default: No installation commands

For deployment engines that support it, install commands will be classified differently in the job history from the regular commands.

primaryOutputDirectoryoptionalstringprimary_output_directoryoptionalstrprimaryOutputDirectoryoptionalStringPrimaryOutputDirectoryoptionalstringPrimaryOutputDirectoryoptional*string#
The directory that will contain the primary output fileset.

Default: No primary output

After running the script, the contents of the given directory will be treated as the primary output of this Step.