aws-cdk-lib.pipelines.FileSet

class FileSet

LanguageType name
.NETAmazon.CDK.Pipelines.FileSet
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#FileSet
Javasoftware.amazon.awscdk.pipelines.FileSet
Pythonaws_cdk.pipelines.FileSet
TypeScript (source)aws-cdk-lib » pipelines » FileSet

Implements IFileSetProducer

A set of files traveling through the deployment pipeline.

Individual steps in the pipeline produce or consume FileSets.

Example

class MyJenkinsStep extends pipelines.Step implements pipelines.ICodePipelineActionFactory {
  constructor(
    private readonly provider: cpactions.JenkinsProvider,
    private readonly input: pipelines.FileSet,
  ) {
    super('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.
    this.discoverReferencedOutputs({
      env: { /* ... */ }
    });
  }

  public produceAction(stage: codepipeline.IStage, options: pipelines.ProduceActionOptions): pipelines.CodePipelineActionFactoryResult {

    // This is where you control what type of Action gets added to the
    // CodePipeline
    stage.addAction(new cpactions.JenkinsAction({
      // Copy 'actionName' and 'runOrder' from the options
      actionName: options.actionName,
      runOrder: options.runOrder,

      // Jenkins-specific configuration
      type: cpactions.JenkinsActionType.TEST,
      jenkinsProvider: this.provider,
      projectName: 'MyJenkinsProject',

      // Translate the FileSet into a codepipeline.Artifact
      inputs: [options.artifacts.toCodePipeline(this.input)],
    }));

    return { runOrdersConsumed: 1 };
  }
}

Initializer

new FileSet(id: string, producer?: Step)

Parameters

  • id string — Human-readable descriptor for this file set (does not need to be unique).
  • producer Step

Properties

NameTypeDescription
idstringHuman-readable descriptor for this file set (does not need to be unique).
producerStepThe Step that produces this FileSet.
primaryOutput?FileSetThe primary output of a file set producer.

id

Type: string

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


producer

Type: Step

The Step that produces this FileSet.


primaryOutput?

Type: FileSet (optional)

The primary output of a file set producer.

The primary output of a FileSet is itself.

Methods

NameDescription
producedBy(producer?)Mark the given Step as the producer for this FileSet.
toString()Return a string representation of this FileSet.

producedBy(producer?)

public producedBy(producer?: Step): void

Parameters

  • producer Step

Mark the given Step as the producer for this FileSet.

This method can only be called once.


toString()

public toString(): string

Returns

  • string

Return a string representation of this FileSet.