Skip to content

Commit

Permalink
feat: add expected pipeline json for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martin.mueller committed Jan 3, 2021
1 parent 947427b commit 6f25e33
Show file tree
Hide file tree
Showing 4 changed files with 1,389 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/pipeline-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,28 @@ export class PipelineStack extends core.Stack {
stageAccount,
);

console.log(`Env: ${JSON.stringify(process.env)}`);
// console.log(`Env: ${JSON.stringify(process.env)}`);

new core.CfnOutput(customStage.customStack, 'Stage', { value: stageAccount.stage || 'not set!' });
new core.CfnOutput(customStage.customStack, 'CommitID', { value: process.env.CODEBUILD_RESOLVED_SOURCE_VERSION || 'not set!' });
new core.CfnOutput(customStage.customStack, 'RepoUrl', { value: `https://github.com/${props.gitHub.owner}/${props.repositoryName}` || 'not set!' });
new core.CfnOutput(customStage.customStack, 'BranchName', { value: props.branch || 'not set!' });
new core.CfnOutput(customStage.customStack, 'BuildUrl', { value: process.env.CODEBUILD_BUILD_URL || 'not set!' });

const preprodStage = cdkPipeline.addApplicationStage(customStage, {
manualApprovals: props.manualApprovals?.call(this, stageAccount),
});

const useOutputs: Record<string, StackOutput> = {};

for (const cfnOutput in customStage.customStack.cfnOutputs) {
console.log(`key: ${cfnOutput}, Outputs: ${JSON.stringify(customStage.customStack.cfnOutputs[cfnOutput])}`);
const output = new core.CfnOutput(customStage.customStack, cfnOutput, customStage.customStack.cfnOutputs[cfnOutput]);
useOutputs[cfnOutput] = cdkPipeline.stackOutput(
output,
);
}

const preprodStage = cdkPipeline.addApplicationStage(customStage, {
manualApprovals: props.manualApprovals?.call(this, stageAccount),
});

const testCommands = props.testCommands ? props.testCommands.call(this, stageAccount) : [];

preprodStage.addActions(
Expand Down
Loading

0 comments on commit 6f25e33

Please sign in to comment.