Step
- class aws_cdk.pipelines.Step(id)
Bases:
object
A generic Step which can be added to a Pipeline.
Steps can be used to add Sources, Build Actions and Validations to your pipeline.
This class is abstract. See specific subclasses of Step for useful steps to add to your Pipeline
- ExampleMetadata:
infused
Example:
@jsii.implements(pipelines.ICodePipelineActionFactory) class MyJenkinsStep(pipelines.Step): def __init__(self, provider, input): super().__init__("MyJenkinsStep") # This is necessary if your step accepts parameters, like environment variables, # that may contain outputs from other steps. It doesn't matter what the # structure is, as long as it contains the values that may contain outputs. self.discover_referenced_outputs({ "env": {} }) def produce_action(self, stage, *, scope, actionName, runOrder, variablesNamespace=None, artifacts, fallbackArtifact=None, pipeline, codeBuildDefaults=None, beforeSelfMutation=None, stackOutputsMap): # This is where you control what type of Action gets added to the # CodePipeline stage.add_action( cpactions.JenkinsAction( # Copy 'actionName' and 'runOrder' from the options action_name=action_name, run_order=run_order, # Jenkins-specific configuration type=cpactions.JenkinsActionType.TEST, jenkins_provider=self.provider, project_name="MyJenkinsProject", # Translate the FileSet into a codepipeline.Artifact inputs=[artifacts.to_code_pipeline(self.input)] )) return pipelines.CodePipelineActionFactoryResult(run_orders_consumed=1)
- Parameters:
id (
str
) – Identifier for this step.
Methods
- add_step_dependency(step)
Add a dependency on another step.
- Parameters:
step (
Step
) –- Return type:
None
- to_string()
Return a string representation of this Step.
- Return type:
str
Attributes
- consumed_stack_outputs
StackOutputReferences this step consumes.
- dependencies
Return the steps this step depends on, based on the FileSets it requires.
- dependency_file_sets
The list of FileSets consumed by this Step.
- id
Identifier for this step.
- is_source
Whether or not this is a Source step.
What it means to be a Source step depends on the engine.
- primary_output
The primary FileSet produced by this Step.
Not all steps produce an output FileSet–if they do you can substitute the
Step
object for theFileSet
object.
Static Methods
- classmethod sequence(steps)
Define a sequence of steps to be executed in order.
If you need more fine-grained step ordering, use the
addStepDependency()
API. For example, if you wantsecondStep
to occur afterfirstStep
, callsecondStep.addStepDependency(firstStep)
.