forked from anomalyco/sst
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
32 lines (24 loc) · 844 Bytes
/
Copy pathbuild.js
File metadata and controls
32 lines (24 loc) · 844 Bytes
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
"use strict";
const chalk = require("chalk");
const { logger } = require("@serverless-stack/core");
const { synth } = require("./util/cdkHelpers");
function printStacks(stacks, usingYarn) {
const l = stacks.length;
const stacksCopy = l === 1 ? "stack" : "stacks";
const deployCmd = usingYarn ? "yarn sst deploy" : "npx sst deploy";
logger.info(
`\nSuccessfully compiled ${l} ${stacksCopy} to ${chalk.cyan(
".build/cdk.out"
)}:\n`
);
for (var i = 0; i < l; i++) {
const stack = stacks[i];
logger.info(` ${chalk.cyan(stack.id)}`);
}
logger.info(`\nRun ${chalk.cyan(deployCmd)} to deploy to AWS.`);
}
module.exports = async function (argv, config, cliInfo) {
logger.info(chalk.grey("Synthesizing CDK"));
const { stacks } = await synth(cliInfo.cdkOptions);
printStacks(stacks, cliInfo.yarn);
};