fierce-bird-8909
06/24/2024, 8:52 PMimport * as pulumi from "@pulumi/pulumi";
import {createStack} from "./application/services/automation.service";
import {getCustomers} from "./application/services/customer.service";
import {CustomerEntity} from "./domain/entities/customer.entity";
import {handleStaticInfrastructure} from "./infrastructure/pulumi/services/infrastructure.pulumi.service";
const run = async () => {
// check if pulumi is dry run
const config = new pulumi.Config();
const customerCursor = await getCustomers();
await handleStaticInfrastructure();
// for await (const customer of customerCursor) {
// console.log('handling customer: ', customer);
// // const customer = await customerCursor.next();
// //
// // if (!customer) {
// // continue;
// // }
// //
// // // create customer entity
// // const customerEntity = new CustomerEntity(
// // customer,
// // config,
// // )
// //
// // // create customer stack
// // const customerStack = await createStack(
// // customerEntity,
// // config,
// // );
// //
// // console.log('stack', customerStack);
// //
// // if (pulumi.runtime.isDryRun()) {
// // // preview stack
// // return await customerStack.preview({onOutput: <http://console.info|console.info>})
// // } else {
// // return await customerStack.up({onOutput: <http://console.info|console.info>});
// // }
// }
console.log('finished');
return {
result: 'finished'
}
}
const runPromise = run();
runPromise.catch(err => console.log(err));
export const result = runPromise.then((result) => result.result);