Skip to content

Commit

Permalink
fix(cli): non-built project bootstrap fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sperka committed May 10, 2024
1 parent c4240fa commit f04e615
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions packages/galileo-cli/src/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export default class DeployCommand extends Command {
}

const modelRegion = context.appConfig.llms.region || appRegion;

const regionsToBootstrap = new Set<string>();
for (const _region of new Set<string>([appRegion, modelRegion])) {
const bootstapInfo = await accountUtils.retrieveCdkBootstrapInfo({
Expand All @@ -121,32 +120,6 @@ export default class DeployCommand extends Command {
}
}

if (regionsToBootstrap.size > 0) {
if (!flags.skipConfirmations) {
const { bootstrapRegions } = context.cachedAnswers(
await prompts(
galileoPrompts.confirmBootstrapRegions({
regions: Array.from(regionsToBootstrap),
account,
}),
),
);

if (!bootstrapRegions) {
console.error(
chalk.redBright('Account must be bootstrapped in all regions to be used, before deployment. Quitting...'),
);
this.exit();
}
}

await this.executeCdkBootstrap({
account,
profile,
regionsToBootstrap,
});
}

context.deployStacks.push(`Dev/${context.appConfig.app.name}`);
context.cdkContext.set('configPath', appConfigPath);

Expand All @@ -170,7 +143,37 @@ export default class DeployCommand extends Command {
)
).confirmed
) {
// build the project
this.executeBuild(flags.build);

// check if bootstrapping needed
if (regionsToBootstrap.size > 0) {
if (!flags.skipConfirmations) {
const { bootstrapRegions } = context.cachedAnswers(
await prompts(
galileoPrompts.confirmBootstrapRegions({
regions: Array.from(regionsToBootstrap),
account,
}),
),
);

if (!bootstrapRegions) {
console.error(
chalk.redBright('Account must be bootstrapped in all regions to be used, before deployment. Quitting...'),
);
this.exit();
}
}

await this.executeCdkBootstrap({
account,
profile,
regionsToBootstrap,
});
}

// deploy into the cloud
this.executeCdkDeploy(cmdDeploy, flags.skipConfirmations);
if (flags.saveExec) {
context.saveExecTasks();
Expand Down

0 comments on commit f04e615

Please sign in to comment.