Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 26bdfbc

Browse files
authored
fix: add branch support for CdkDeployer (#521)
1 parent e118f41 commit 26bdfbc

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

core/API.md

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/common/cdk-deployer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export interface CdkDeployerProps extends cdk.StackProps {
4141
* @default - The root of the repository
4242
*/
4343
readonly cdkAppLocation?: string;
44+
/**
45+
* The branch to use on the Github repository.
46+
* @default - The main branch of the repository
47+
*/
48+
readonly gitBranch?: string;
4449
}
4550

4651
/**
@@ -230,6 +235,7 @@ export class CdkDeployer extends cdk.Stack {
230235
source: Source.gitHub({
231236
owner: props.githubRepository.split('/')[0],
232237
repo: props.githubRepository.split('/')[1],
238+
branchOrRef: props.gitBranch ? props.gitBranch : undefined,
233239
reportBuildStatus: true,
234240
}),
235241
buildSpec: BuildSpec.fromObject({

core/test/e2e/cdk-deployer.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const integTestApp = new cdk.App();
1919
const cdkDeployerStack = new CdkDeployer(integTestApp, 'CdkDeployerE2ETest', {
2020
githubRepository: 'aws-samples/aws-analytics-reference-architecture',
2121
cdkAppLocation: 'refarch/aws-native',
22+
gitBranch: 'main',
2223
cdkParameters: {
2324
QuickSightUsername: {
2425
default: 'gromav/gromav-Isengard',
@@ -47,5 +48,5 @@ describe('deploy succeed', () => {
4748
});
4849

4950
afterAll(async () => {
50-
//await destroyStack(integTestApp, cdkDeployerStack);
51+
await destroyStack(integTestApp, cdkDeployerStack);
5152
});

0 commit comments

Comments
 (0)