primaryOutputFileSetprimary_outputFileSetprimaryOutputFileSetPrimaryOutputFileSetPrimaryOutputFileSet#Not all steps produce an output FileSet--if they do you can substitute the Step object for the FileSet object.
Run shell script commands in the pipeline.
This is a generic step designed to be deployment engine agnostic.
pipelines/lib/blueprint/shell-step.tsdeclare 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,
})],
});
# pipeline: pipelines.CodePipeline
preprod = MyApplicationStage(self, "PreProd")
prod = MyApplicationStage(self, "Prod")
topic = sns.Topic(self, "ChangeApprovalTopic")
pipeline.add_stage(preprod,
post=[
pipelines.ShellStep("Validate Endpoint",
commands=["curl -Ssf https://my.webservice.com/"]
)
]
)
pipeline.add_stage(prod,
pre=[pipelines.ManualApprovalStep("PromoteToProd",
# All options below are optional
comment="Please validate changes",
review_url="https://my.webservice.com/",
notification_topic=topic
)]
)
CodePipeline pipeline;
MyApplicationStage preprod = new MyApplicationStage(this, "PreProd");
MyApplicationStage prod = new MyApplicationStage(this, "Prod");
Topic topic = new Topic(this, "ChangeApprovalTopic");
pipeline.addStage(preprod, AddStageOpts.builder()
.post(List.of(
ShellStep.Builder.create("Validate Endpoint")
.commands(List.of("curl -Ssf https://my.webservice.com/"))
.build()))
.build());
pipeline.addStage(prod, AddStageOpts.builder()
.pre(List.of(ManualApprovalStep.Builder.create("PromoteToProd")
//All options below are optional
.comment("Please validate changes")
.reviewUrl("https://my.webservice.com/")
.notificationTopic(topic)
.build()))
.build());
// Install: dotnet add package Amazon.CDK.Lib
CodePipeline pipeline;
var preprod = new MyApplicationStage(this, "PreProd");
var prod = new MyApplicationStage(this, "Prod");
var topic = new Topic(this, "ChangeApprovalTopic");
pipeline.AddStage(preprod, new AddStageOpts {
Post = new [] {
new ShellStep("Validate Endpoint", new ShellStepProps {
Commands = new [] { "curl -Ssf https://my.webservice.com/" }
}) }
});
pipeline.AddStage(prod, new AddStageOpts {
Pre = new [] { new ManualApprovalStep("PromoteToProd", new ManualApprovalStepProps {
//All options below are optional
Comment = "Please validate changes",
ReviewUrl = "https://my.webservice.com/",
NotificationTopic = topic
}) }
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var pipeline CodePipeline
preprod := NewMyApplicationStage(this, jsii.String("PreProd"))
prod := NewMyApplicationStage(this, jsii.String("Prod"))
topic := sns.NewTopic(this, jsii.String("ChangeApprovalTopic"))
pipeline.AddStage(preprod, &AddStageOpts{
Post: []Step{
pipelines.NewShellStep(jsii.String("Validate Endpoint"), &ShellStepProps{
Commands: []*string{
jsii.String("curl -Ssf https://my.webservice.com/"),
},
}),
},
})
pipeline.AddStage(prod, &AddStageOpts{
Pre: []Step{
pipelines.NewManualApprovalStep(jsii.String("PromoteToProd"), &ManualApprovalStepProps{
//All options below are optional
Comment: jsii.String("Please validate changes"),
ReviewUrl: jsii.String("https://my.webservice.com/"),
NotificationTopic: topic,
}),
},
})
new ShellStep(id: string, props: ShellStepProps)
ShellStep(id: str, props: ShellStepProps)
new ShellStep(String id, ShellStepProps props)
new ShellStep(string id, ShellStepProps props)
NewShellStep(Id *string, Props ShellStepProps)
commandsstring[]commandstyping.List[str]commandsList<String>Commandsstring[]Commands*[]*stringrequired#consumedStackOutputsStackOutputReference[]consumed_stack_outputstyping.List[StackOutputReference]consumedStackOutputsList<StackOutputReference>ConsumedStackOutputsStackOutputReference[]ConsumedStackOutputs*[]StackOutputReferencerequired#dependenciesStep[]dependenciestyping.List[Step]dependenciesList<Step>DependenciesStep[]Dependencies*[]Steprequired#dependencyFileSetsFileSet[]dependency_file_setstyping.List[FileSet]dependencyFileSetsList<FileSet>DependencyFileSetsFileSet[]DependencyFileSets*[]FileSetrequired#env{ [key: string]: string }envtyping.Mapping[str, str]envMap<String, String>EnvIDictionary<string, string>Env*map[string]*string= No environment variablesrequired#envFromCfnOutputs{ [key: string]: StackOutputReference }env_from_cfn_outputstyping.Mapping[str, StackOutputReference]envFromCfnOutputsMap<String, StackOutputReference>EnvFromCfnOutputsIDictionary<string, StackOutputReference>EnvFromCfnOutputs*map[string]StackOutputReference= No environment variables created…required#Default: No environment variables created from stack outputs
inputsFileSetLocation[]inputstyping.List[FileSetLocation]inputsList<FileSetLocation>InputsFileSetLocation[]Inputs*[]FileSetLocationrequired#A list of (FileSet, directory) pairs, which are a copy of the input properties. This list should not be modified directly.
installCommandsstring[]install_commandstyping.List[str]installCommandsList<String>InstallCommandsstring[]InstallCommands*[]*string= No installation commandsrequired#For deployment engines that support it, install commands will be classified differently in the job history from the regular commands.
What it means to be a Source step depends on the engine.
outputsFileSetLocation[]outputstyping.List[FileSetLocation]outputsList<FileSetLocation>OutputsFileSetLocation[]Outputs*[]FileSetLocationrequired#A list of (FileSet, directory) pairs, which are a copy of the input properties. This list should not be modified directly.
addOutputDirectory(directory: string): FileSetdef add_output_directory(self, directory: str) -> FileSetpublic FileSet addOutputDirectory(String directory)public FileSet AddOutputDirectory(string directory)func AddOutputDirectory(Directory *string) FileSet#After running the script, the contents of the given directory will be exported as a FileSet. Use the FileSet as the input to another step.
Multiple calls with the exact same directory name string (not normalized) will return the same FileSet.
addStepDependency(step: Step): voiddef add_step_dependency(self, step: Step) -> Nonepublic void addStepDependency(Step step)public void AddStepDependency(Step step)func AddStepDependency(Step Step)#primaryOutputDirectory(directory: string): FileSetdef primary_output_directory(self, directory: str) -> FileSetpublic FileSet primaryOutputDirectory(String directory)public FileSet PrimaryOutputDirectory(string directory)func PrimaryOutputDirectory(Directory *string) FileSet#If no primary output has been configured yet, this directory will become the primary output of this ShellStep, otherwise this method will throw if the given directory is different than the currently configured primary output directory.
sequence(steps: Step[]): Step[]@staticmethod def sequence(steps: typing.List[Step]) -> typing.List[Step]public static List<Step> sequence(List<Step> steps)public static Step[] Sequence(Step[] steps)func Sequence(Steps *[]Step) *[]Stepstatic#If you need more fine-grained step ordering, use the addStepDependency() API. For example, if you want secondStep to occur after firstStep, call secondStep.addStepDependency(firstStep).
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#