diff --git a/packages/cli/templates/infra/.cdkgraphrc.js b/packages/cli/templates/infra/.cdkgraphrc.js index b3dc24f..a54a76d 100644 --- a/packages/cli/templates/infra/.cdkgraphrc.js +++ b/packages/cli/templates/infra/.cdkgraphrc.js @@ -1,3 +1,3 @@ module.exports = { - outdir: 'graph', + outdir: '../report/infra', } diff --git a/packages/cli/templates/infra/gitignore b/packages/cli/templates/infra/gitignore index 2d321b6..722ca33 100644 --- a/packages/cli/templates/infra/gitignore +++ b/packages/cli/templates/infra/gitignore @@ -6,7 +6,4 @@ node_modules # CDK asset staging directory .cdk.staging -cdk.out - -# -graph \ No newline at end of file +cdk.out \ No newline at end of file diff --git a/packages/cli/templates/infra/libs/pipeline-stack.ts b/packages/cli/templates/infra/libs/pipeline-stack.ts index 9354ce4..f9a5827 100644 --- a/packages/cli/templates/infra/libs/pipeline-stack.ts +++ b/packages/cli/templates/infra/libs/pipeline-stack.ts @@ -48,11 +48,16 @@ export class PipelineStack extends Stack { const testStep = new CodeBuildStep(`${prefix}Test`, { projectName: `${prefix}Test`, installCommands: [ + 'apt install graphviz -y', 'npm i -g pnpm', 'npm ci', 'pnpm --dir ./infra install --frozen-lockfile', ], - commands: ['npm run test', 'npm --prefix ./infra run test'], + commands: [ + 'npm run test', // source test + 'npm --prefix ./infra run test', // infra snapshot test + 'npm --prefix ./infra run cdk synth', // generate infra diagram + ], primaryOutputDirectory: 'report', partialBuildSpec: BuildSpec.fromObject({ reports: {