interface ShellStepProps
Language | Type name |
---|---|
![]() | Amazon.CDK.Pipelines.ShellStepProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/pipelines#ShellStepProps |
![]() | software.amazon.awscdk.pipelines.ShellStepProps |
![]() | aws_cdk.pipelines.ShellStepProps |
![]() | 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
Name | Type | Description |
---|---|---|
commands | string[] | Commands to run. |
additional | { [string]: IFile } | Additional FileSets to put in other directories. |
env? | { [string]: string } | Environment variables to set. |
env | { [string]: Cfn } | Set environment variables based on Stack Outputs. |
input? | IFile | FileSet to run these scripts on. |
install | string[] | Installation commands to run before the regular commands. |
primary | string | The directory that will contain the primary output fileset. |
commands
Type:
string[]
Commands to run.
additionalInputs?
Type:
{ [string]:
IFile
}
(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]:
Cfn
}
(optional, default: No environment variables created from stack outputs)
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.
input?
Type:
IFile
(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.