-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
integ.pipeline-code-commit-main.ts
44 lines (39 loc) · 1.29 KB
/
integ.pipeline-code-commit-main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as codecommit from 'aws-cdk-lib/aws-codecommit';
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as cdk from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME, CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 } from 'aws-cdk-lib/cx-api';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
const defaultFeatureFlag = {
[CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME]: true,
[CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2]: false,
};
const app = new cdk.App({ postCliContext: defaultFeatureFlag });
const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-codecommit-main');
const repo = new codecommit.Repository(stack, 'MyRepo', {
repositoryName: 'my-repo',
});
new codepipeline.Pipeline(stack, 'Pipeline', {
crossAccountKeys: true,
stages: [
{
stageName: 'source',
actions: [
new cpactions.CodeCommitSourceAction({
actionName: 'source',
repository: repo,
output: new codepipeline.Artifact('SourceArtifact'),
}),
],
},
{
stageName: 'build',
actions: [
new cpactions.ManualApprovalAction({ actionName: 'manual' }),
],
},
],
});
new IntegTest(app, 'IntegTest', {
testCases: [stack],
});