# PipelineBase

A generic CDK Pipelines pipeline.

Different deployment systems will provide subclasses of `Pipeline` that generate
the deployment infrastructure necessary to deploy CDK apps, specific to that system.

This library comes with the `CodePipeline` class, which uses AWS CodePipeline
to deploy CDK apps.

The actual pipeline infrastructure is constructed (by invoking the engine)
when `buildPipeline()` is called, or when `app.synth()` is called (whichever
happens first).

Extends: [Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Construct.html) › PipelineBase
Implements: [IConstruct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.IConstruct.html), [IDependable](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.IDependable.html)
Superclass of: [CodePipeline](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.CodePipeline.html)
Used as argument in: [StackOutputsMap (initializer)](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackOutputsMap.html#initializer)

- Source: [`pipelines/lib/main/pipeline-base.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/pipelines/lib/main/pipeline-base.ts#L39)
- Type last changed: v2.38.0 · 17 Aug 2022

## Initializer

TypeScript:

```ts
new PipelineBase(scope: Construct, id: string, props: PipelineBaseProps)
```

Python:

```python
PipelineBase(scope: Construct, id: str, props: PipelineBaseProps)
```

Java:

```java
new PipelineBase(Construct scope, String id, PipelineBaseProps props)
```

C# / .NET:

```csharp
new PipelineBase(Construct scope, string id, PipelineBaseProps props)
```

Golang:

```go
NewPipelineBase(Scope Construct, Id *string, Props PipelineBaseProps)
```

## Construct Props

- `synth`: [IFileSetProducer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.IFileSetProducer.html) (required) — The build step that produces the CDK Cloud Assembly.

  The primary output of this step needs to be the `cdk.out` directory
  generated by the `cdk synth` command.

  If you use a `ShellStep` here and you don't configure an output directory,
  the output directory will automatically be assumed to be `cdk.out`.

## Properties

- `cloudAssemblyFileSet`: [FileSet](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.FileSet.html) — The FileSet tha contains the cloud assembly.

  This is the primary output of the synth step.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `synth`: [IFileSetProducer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.IFileSetProducer.html) — The build step that produces the CDK Cloud Assembly.

- `waves`: [Wave](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.Wave.html)[] — The waves in this pipeline.

## Methods

- `addStage(stage: Stage, options?: AddStageOpts): StageDeployment` — Deploy a single Stage by itself.

  Add a Stage to the pipeline, to be deployed in sequence with other
  Stages added to the pipeline. All Stacks in the stage will be deployed
  in an order automatically determined by their relative dependencies.

- `addWave(id: string, options?: WaveOptions): Wave` — Add a Wave to the pipeline, for deploying multiple Stages in parallel.

  Use the return object of this method to deploy multiple stages in parallel.

  Example:

  ```ts
  declare const pipeline: pipelines.CodePipeline;

  const wave = pipeline.addWave('MyWave');
  wave.addStage(new MyApplicationStage(this, 'Stage1'));
  wave.addStage(new MyApplicationStage(this, 'Stage2'));
  ```

- `buildPipeline(): void` — Send the current pipeline definition to the engine, and construct the pipeline.

  It is not possible to modify the pipeline after calling this method.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isPipeline(x: any): boolean` (static) — Return whether the given object extends `PipelineBase`.

  We do attribute detection since we can't reliably use 'instanceof'.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
