@flit/cdk-pipeline 1.5.0 → 2.1.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/.jsii +29 -3
- package/dist/artifact.js +2 -2
- package/dist/code-commit-source-segment.js +3 -3
- package/dist/code-star-source-segment.js +3 -3
- package/dist/git-hub-source-segment.js +3 -3
- package/dist/pipeline-segment.js +6 -6
- package/dist/pipeline.js +3 -3
- package/dist/publish-assets-action.js +2 -2
- package/dist/s3-source-segment.js +3 -3
- package/dist/segment.js +3 -3
- package/dist/source-segment.js +2 -2
- package/dist/stack-segment.js +13 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -14
- package/src/artifact.ts +18 -18
- package/src/code-commit-source-segment.ts +35 -35
- package/src/code-star-source-segment.ts +59 -59
- package/src/git-hub-source-segment.ts +55 -55
- package/src/pipeline-segment.ts +138 -138
- package/src/pipeline.ts +1 -1
- package/src/publish-assets-action.ts +102 -102
- package/src/s3-source-segment.ts +36 -36
- package/src/segment.ts +22 -22
- package/src/source-segment.ts +3 -3
- package/src/stack-segment.ts +70 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flit/cdk-pipeline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.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",
|
|
@@ -48,22 +48,14 @@
|
|
|
48
48
|
"plugins": [
|
|
49
49
|
"prettier-plugin-packagejson"
|
|
50
50
|
],
|
|
51
|
-
"
|
|
52
|
-
"overrides": [
|
|
53
|
-
{
|
|
54
|
-
"files": "*.sublime-project",
|
|
55
|
-
"options": {
|
|
56
|
-
"parser": "json"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
]
|
|
51
|
+
"useTabs": true
|
|
60
52
|
},
|
|
61
53
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^24.
|
|
63
|
-
"aws-cdk-lib": "^2.
|
|
54
|
+
"@types/node": "^24.3.1",
|
|
55
|
+
"aws-cdk-lib": "^2.214.0",
|
|
64
56
|
"constructs": "^10.4.2",
|
|
65
|
-
"jsii": "^5.9.
|
|
66
|
-
"jsii-pacmak": "^1.
|
|
57
|
+
"jsii": "^5.9.4",
|
|
58
|
+
"jsii-pacmak": "^1.114.1",
|
|
67
59
|
"prettier": "^3.6.2",
|
|
68
60
|
"prettier-plugin-packagejson": "^2.5.19",
|
|
69
61
|
"typescript": "^5.9.2"
|
package/src/artifact.ts
CHANGED
|
@@ -3,22 +3,22 @@ import { Artifact as AwsArtifact } from "aws-cdk-lib/aws-codepipeline";
|
|
|
3
3
|
import { Segment } from "./segment";
|
|
4
4
|
|
|
5
5
|
export class Artifact extends AwsArtifact {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
private _producer?: Segment;
|
|
7
|
+
private _consumers: Segment[] = [];
|
|
8
|
+
constructor(artifactName?: string) {
|
|
9
|
+
super(artifactName);
|
|
10
|
+
}
|
|
11
|
+
produce(producer: Segment) {
|
|
12
|
+
if (this._producer) throw new Error("Artifact is already produced");
|
|
13
|
+
this._producer = producer;
|
|
14
|
+
}
|
|
15
|
+
consume(producer: Segment) {
|
|
16
|
+
this.consumers.push(producer);
|
|
17
|
+
}
|
|
18
|
+
get producer(): Segment | undefined {
|
|
19
|
+
return this._producer;
|
|
20
|
+
}
|
|
21
|
+
get consumers(): Segment[] {
|
|
22
|
+
return this._consumers;
|
|
23
|
+
}
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAction } from "aws-cdk-lib/aws-codepipeline";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
CodeCommitSourceAction,
|
|
4
|
+
CodeCommitTrigger,
|
|
5
5
|
} from "aws-cdk-lib/aws-codepipeline-actions";
|
|
6
6
|
import { IRepository } from "aws-cdk-lib/aws-codecommit";
|
|
7
7
|
|
|
@@ -11,50 +11,50 @@ import { SegmentConstructed } from "./segment";
|
|
|
11
11
|
import { SourceSegment, SourceSegmentProps } from "./source-segment";
|
|
12
12
|
|
|
13
13
|
export interface CodeCommitSourceSegmentProps extends SourceSegmentProps {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
readonly repository: IRepository;
|
|
15
|
+
readonly branch?: string;
|
|
16
|
+
readonly trigger?: CodeCommitTrigger;
|
|
17
|
+
readonly variablesNamespace?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @category Segments
|
|
22
22
|
*/
|
|
23
23
|
export class CodeCommitSourceSegment extends SourceSegment {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
private props: CodeCommitSourceSegmentProps;
|
|
25
|
+
constructor(props: CodeCommitSourceSegmentProps) {
|
|
26
|
+
super(props);
|
|
27
|
+
this.props = props;
|
|
28
|
+
}
|
|
29
|
+
construct(scope: Pipeline): SegmentConstructed {
|
|
30
|
+
const name = `${this.props.repository}-${this.props.branch || "master"}`;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
return new CodeCommitSourceSegmentConstructed(scope, name, {
|
|
33
|
+
...this.props,
|
|
34
|
+
actionName: name,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface CodeCommitSourceSegmentConstructedProps {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
readonly output: Artifact;
|
|
41
|
+
readonly actionName: string;
|
|
42
|
+
readonly repository: IRepository;
|
|
43
|
+
readonly branch?: string;
|
|
44
|
+
readonly trigger?: CodeCommitTrigger;
|
|
45
|
+
readonly variablesNamespace?: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export class CodeCommitSourceSegmentConstructed extends SegmentConstructed {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly actions: IAction[];
|
|
51
|
+
constructor(
|
|
52
|
+
scope: Pipeline,
|
|
53
|
+
id: string,
|
|
54
|
+
props: CodeCommitSourceSegmentConstructedProps,
|
|
55
|
+
) {
|
|
56
|
+
super(scope, id);
|
|
57
|
+
this.name = "Source";
|
|
58
|
+
this.actions = [new CodeCommitSourceAction(props)];
|
|
59
|
+
}
|
|
60
60
|
}
|
|
@@ -7,76 +7,76 @@ import { SegmentConstructed } from "./segment";
|
|
|
7
7
|
import { SourceSegment, SourceSegmentProps } from "./source-segment";
|
|
8
8
|
|
|
9
9
|
export interface CodeStarSourceSegmentProps extends SourceSegmentProps {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The owning user or organization of the repository.
|
|
12
|
+
* @example "aws"
|
|
13
|
+
*/
|
|
14
|
+
readonly owner: string;
|
|
15
|
+
/**
|
|
16
|
+
* The ARN of the CodeStar Connection created in the AWS console
|
|
17
|
+
* that has permissions to access this GitHub or BitBucket repository.
|
|
18
|
+
* @example `"arn:aws:codestar-connections:us-east-1:123456789012:connection/12345678-abcd-12ab-34cdef5678gh"`
|
|
19
|
+
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/connections-create.html
|
|
20
|
+
*/
|
|
21
|
+
readonly connectionArn: string;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the repository.
|
|
24
|
+
* @example "aws-cdk"
|
|
25
|
+
*/
|
|
26
|
+
readonly repository: string;
|
|
27
|
+
/**
|
|
28
|
+
* The branch to build.
|
|
29
|
+
* @default "master"
|
|
30
|
+
*/
|
|
31
|
+
readonly branch?: string;
|
|
32
|
+
readonly triggerOnPush?: boolean;
|
|
33
|
+
readonly variablesNamespace?: string;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @category Segments
|
|
38
38
|
*/
|
|
39
39
|
export class CodeStarSourceSegment extends SourceSegment {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
private props: CodeStarSourceSegmentProps;
|
|
41
|
+
constructor(props: CodeStarSourceSegmentProps) {
|
|
42
|
+
super(props);
|
|
43
|
+
this.props = props;
|
|
44
|
+
}
|
|
45
|
+
construct(scope: Pipeline): SegmentConstructed {
|
|
46
|
+
const name = `${this.props.owner}-${this.props.repository}-${
|
|
47
|
+
this.props.branch || "master"
|
|
48
|
+
}`;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
return new CodeStarSourceSegmentConstructed(scope, name, {
|
|
51
|
+
...this.props,
|
|
52
|
+
actionName: name,
|
|
53
|
+
repo: this.props.repository,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface CodeStarSourceSegmentConstructedProps {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
readonly output: Artifact;
|
|
60
|
+
readonly actionName: string;
|
|
61
|
+
readonly connectionArn: string;
|
|
62
|
+
readonly owner: string;
|
|
63
|
+
readonly repo: string;
|
|
64
|
+
readonly branch?: string;
|
|
65
|
+
readonly runOrder?: number;
|
|
66
|
+
readonly triggerOnPush?: boolean;
|
|
67
|
+
readonly variablesNamespace?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export class CodeStarSourceSegmentConstructed extends SegmentConstructed {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly actions: IAction[];
|
|
73
|
+
constructor(
|
|
74
|
+
scope: Pipeline,
|
|
75
|
+
id: string,
|
|
76
|
+
props: CodeStarSourceSegmentConstructedProps,
|
|
77
|
+
) {
|
|
78
|
+
super(scope, id);
|
|
79
|
+
this.name = "Source";
|
|
80
|
+
this.actions = [new CodeStarConnectionsSourceAction(props)];
|
|
81
|
+
}
|
|
82
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAction } from "aws-cdk-lib/aws-codepipeline";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
GitHubSourceAction,
|
|
4
|
+
GitHubTrigger,
|
|
5
5
|
} from "aws-cdk-lib/aws-codepipeline-actions";
|
|
6
6
|
import { SecretValue } from "aws-cdk-lib";
|
|
7
7
|
|
|
@@ -11,70 +11,70 @@ import { SegmentConstructed } from "./segment";
|
|
|
11
11
|
import { SourceSegment, SourceSegmentProps } from "./source-segment";
|
|
12
12
|
|
|
13
13
|
export interface GitHubSourceSegmentProps extends SourceSegmentProps {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
readonly oauthToken: SecretValue;
|
|
15
|
+
/**
|
|
16
|
+
* The owning user or organization of the repository.
|
|
17
|
+
* @example "aws"
|
|
18
|
+
*/
|
|
19
|
+
readonly owner: string;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the repository.
|
|
22
|
+
* @example "aws-cdk"
|
|
23
|
+
*/
|
|
24
|
+
readonly repository: string;
|
|
25
|
+
/**
|
|
26
|
+
* The branch to build.
|
|
27
|
+
* @default "master"
|
|
28
|
+
*/
|
|
29
|
+
readonly branch?: string;
|
|
30
|
+
readonly trigger?: GitHubTrigger;
|
|
31
|
+
readonly variablesNamespace?: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* @category Segments
|
|
36
36
|
*/
|
|
37
37
|
export class GitHubSourceSegment extends SourceSegment {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
private props: GitHubSourceSegmentProps;
|
|
39
|
+
constructor(props: GitHubSourceSegmentProps) {
|
|
40
|
+
super(props);
|
|
41
|
+
this.props = props;
|
|
42
|
+
}
|
|
43
|
+
construct(scope: Pipeline): SegmentConstructed {
|
|
44
|
+
const name = `${this.props.owner}-${this.props.repository}-${
|
|
45
|
+
this.props.branch || "master"
|
|
46
|
+
}`;
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
return new GitHubSourceSegmentConstructed(scope, name, {
|
|
49
|
+
...this.props,
|
|
50
|
+
actionName: name,
|
|
51
|
+
repo: this.props.repository,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface GitHubSourceSegmentConstructedProps {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
readonly output: Artifact;
|
|
58
|
+
readonly actionName: string;
|
|
59
|
+
readonly oauthToken: SecretValue;
|
|
60
|
+
readonly owner: string;
|
|
61
|
+
readonly repo: string;
|
|
62
|
+
readonly branch?: string;
|
|
63
|
+
readonly runOrder?: number;
|
|
64
|
+
readonly trigger?: GitHubTrigger;
|
|
65
|
+
readonly variablesNamespace?: string;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export class GitHubSourceSegmentConstructed extends SegmentConstructed {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly actions: IAction[];
|
|
71
|
+
constructor(
|
|
72
|
+
scope: Pipeline,
|
|
73
|
+
id: string,
|
|
74
|
+
props: GitHubSourceSegmentConstructedProps,
|
|
75
|
+
) {
|
|
76
|
+
super(scope, id);
|
|
77
|
+
this.name = "Source";
|
|
78
|
+
this.actions = [new GitHubSourceAction(props)];
|
|
79
|
+
}
|
|
80
80
|
}
|