FileSet

class aws_cdk.pipelines.FileSet(id, producer=None)

Bases: object

A set of files traveling through the deployment pipeline.

Individual steps in the pipeline produce or consume ``FileSet``s.

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) – Human-readable descriptor for this file set (does not need to be unique).

  • producer (Optional[Step]) –

Methods

produced_by(producer=None)

Mark the given Step as the producer for this FileSet.

This method can only be called once.

Parameters:

producer (Optional[Step]) –

Return type:

None

to_string()

Return a string representation of this FileSet.

Return type:

str

Attributes

id

Human-readable descriptor for this file set (does not need to be unique).

primary_output

The primary output of a file set producer.

The primary output of a FileSet is itself.

producer

The Step that produces this FileSet.