@flit/cdk-pipeline 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flit/cdk-pipeline",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "A highly customizable and extensible CI/CD pipeline intended as alternative to CDK's native CodePipeline",
5
5
  "keywords": [
6
6
  "aws",
@@ -27,16 +27,12 @@ export class CodeCommitSourceSegment extends SourceSegment {
27
27
  this.props = props;
28
28
  }
29
29
  construct(scope: Pipeline): SegmentConstructed {
30
- const name = `${this.props.repository}/${this.props.branch || "master"}`;
30
+ const name = `${this.props.repository}-${this.props.branch || "master"}`;
31
31
 
32
- return new CodeCommitSourceSegmentConstructed(
33
- scope,
34
- name.replace("/", "-"),
35
- {
36
- ...this.props,
37
- actionName: name,
38
- },
39
- );
32
+ return new CodeCommitSourceSegmentConstructed(scope, name, {
33
+ ...this.props,
34
+ actionName: name,
35
+ });
40
36
  }
41
37
  }
42
38
 
@@ -9,7 +9,7 @@ import { SourceSegment, SourceSegmentProps } from "./source-segment";
9
9
  export interface CodeStarSourceSegmentProps extends SourceSegmentProps {
10
10
  /**
11
11
  * The owning user or organization of the repository.
12
- * @example `"aws"`
12
+ * @example "aws"
13
13
  */
14
14
  readonly owner: string;
15
15
  /**
@@ -21,12 +21,12 @@ export interface CodeStarSourceSegmentProps extends SourceSegmentProps {
21
21
  readonly connectionArn: string;
22
22
  /**
23
23
  * The name of the repository.
24
- * @example `"aws-cdk"`
24
+ * @example "aws-cdk"
25
25
  */
26
26
  readonly repository: string;
27
27
  /**
28
28
  * The branch to build.
29
- * @default `"master"`
29
+ * @default "master"
30
30
  */
31
31
  readonly branch?: string;
32
32
  readonly triggerOnPush?: boolean;
@@ -43,11 +43,11 @@ export class CodeStarSourceSegment extends SourceSegment {
43
43
  this.props = props;
44
44
  }
45
45
  construct(scope: Pipeline): SegmentConstructed {
46
- const name = `${this.props.owner}/${this.props.repository}/${
46
+ const name = `${this.props.owner}-${this.props.repository}-${
47
47
  this.props.branch || "master"
48
48
  }`;
49
49
 
50
- return new CodeStarSourceSegmentConstructed(scope, name.replace("/", "-"), {
50
+ return new CodeStarSourceSegmentConstructed(scope, name, {
51
51
  ...this.props,
52
52
  actionName: name,
53
53
  repo: this.props.repository,
@@ -14,17 +14,17 @@ export interface GitHubSourceSegmentProps extends SourceSegmentProps {
14
14
  readonly oauthToken: SecretValue;
15
15
  /**
16
16
  * The owning user or organization of the repository.
17
- * @example `"aws"`
17
+ * @example "aws"
18
18
  */
19
19
  readonly owner: string;
20
20
  /**
21
21
  * The name of the repository.
22
- * @example `"aws-cdk"`
22
+ * @example "aws-cdk"
23
23
  */
24
24
  readonly repository: string;
25
25
  /**
26
26
  * The branch to build.
27
- * @default `"master"`
27
+ * @default "master"
28
28
  */
29
29
  readonly branch?: string;
30
30
  readonly trigger?: GitHubTrigger;
@@ -41,11 +41,11 @@ export class GitHubSourceSegment extends SourceSegment {
41
41
  this.props = props;
42
42
  }
43
43
  construct(scope: Pipeline): SegmentConstructed {
44
- const name = `${this.props.owner}/${this.props.repository}/${
44
+ const name = `${this.props.owner}-${this.props.repository}-${
45
45
  this.props.branch || "master"
46
46
  }`;
47
47
 
48
- return new GitHubSourceSegmentConstructed(scope, name.replace("/", "-"), {
48
+ return new GitHubSourceSegmentConstructed(scope, name, {
49
49
  ...this.props,
50
50
  actionName: name,
51
51
  repo: this.props.repository,
package/src/pipeline.ts CHANGED
@@ -20,7 +20,7 @@ export interface PipelineProps extends StackProps {
20
20
  /**
21
21
  * The path to the cdk projects root directory containing the cdk.json file
22
22
  * relative to the asset root
23
- * @default `"."`
23
+ * @default "."
24
24
  */
25
25
  readonly rootDir?: string;
26
26
  /**
@@ -29,9 +29,9 @@ export class S3SourceSegment extends SourceSegment {
29
29
  this.props = props;
30
30
  }
31
31
  construct(scope: Pipeline): SegmentConstructed {
32
- const name = `${this.props.bucket}/${this.props.bucketKey}`;
32
+ const name = `${this.props.bucket}-${this.props.bucketKey}`;
33
33
 
34
- return new S3SourceSegmentConstructed(scope, name.replace("/", "-"), {
34
+ return new S3SourceSegmentConstructed(scope, name, {
35
35
  ...this.props,
36
36
  actionName: name,
37
37
  });
@@ -48,18 +48,22 @@ export interface StackSegmentProps {
48
48
  * @default The name of the given stack.
49
49
  */
50
50
  readonly stackName?: string;
51
+ /**
52
+ * The artifact to hold the output of the build if this stack includes a build.
53
+ */
54
+ readonly buildOutput?: Artifact;
51
55
  /**
52
56
  * The artifact to hold the stack deployment output file.
53
57
  */
54
- readonly output?: Artifact;
58
+ readonly stackOutput?: Artifact;
55
59
  /**
56
60
  * The filename for the file in the output artifact
57
- * @default `"artifact.json"`
61
+ * @default "artifact.json"
58
62
  */
59
63
  readonly outputFileName?: string;
60
64
  /**
61
65
  * Does this stage require manual approval of the change set?
62
- * @default `false`
66
+ * @default false
63
67
  */
64
68
  readonly manualApproval?: Boolean;
65
69
  }
@@ -71,7 +75,10 @@ export class StackSegment extends Segment {
71
75
  readonly props: StackSegmentProps;
72
76
 
73
77
  constructor(props: StackSegmentProps) {
74
- super(props);
78
+ super({
79
+ ...props,
80
+ output: [props.buildOutput, props.stackOutput].filter((a) => !!a),
81
+ });
75
82
  this.props = props;
76
83
  }
77
84
 
@@ -95,7 +102,8 @@ export interface StackSegmentConstructedProps {
95
102
  readonly stackName?: string;
96
103
  readonly input: Artifact;
97
104
  readonly extraInputs?: Artifact[];
98
- readonly output?: Artifact;
105
+ readonly buildOutput?: Artifact;
106
+ readonly stackOutput?: Artifact;
99
107
  readonly outputFileName?: string;
100
108
  readonly manualApproval?: Boolean;
101
109
  }
@@ -113,7 +121,9 @@ export class StackSegmentConstructed extends SegmentConstructed {
113
121
 
114
122
  this.name = props.stack.stackName;
115
123
 
116
- const buildArtifact = props.project ? new Artifact() : undefined;
124
+ const buildArtifact = props.project
125
+ ? props.buildOutput || new Artifact()
126
+ : undefined;
117
127
 
118
128
  this.actions = [
119
129
  ...(buildArtifact
@@ -184,11 +194,11 @@ export class StackSegmentConstructed extends SegmentConstructed {
184
194
  account: props.stack.account,
185
195
  region: props.stack.region,
186
196
  changeSetName: `${props.stack.stackName}Changes`,
187
- output: props.output,
197
+ output: props.stackOutput,
188
198
  outputFileName: props.outputFileName
189
199
  ? props.outputFileName
190
- : props.output
191
- ? `artifact.json`
200
+ : props.stackOutput
201
+ ? "artifact.json"
192
202
  : undefined,
193
203
  }),
194
204
  ];