From 3975021dc0385e4fa0e4ee601d39429190a0403a Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 14 Dec 2024 14:36:38 +1030 Subject: [PATCH] chore: Remove cluster creation bootstrap script --- app/components/services-quickstart.tsx | 6 +-- cli/src/commands/bootstrap.ts | 75 -------------------------- 2 files changed, 3 insertions(+), 78 deletions(-) diff --git a/app/components/services-quickstart.tsx b/app/components/services-quickstart.tsx index d8ebbe01..e9464a53 100644 --- a/app/components/services-quickstart.tsx +++ b/app/components/services-quickstart.tsx @@ -16,9 +16,9 @@ export function ServicesQuickstart({ clusterId }: { clusterId: string }) { inf auth login`; const languageSpecificCommands = { - node: `inf bootstrap node --dir=inferable-app-${clusterId} --no-cluster=true`, - golang: `inf bootstrap go --dir=inferable-app-${clusterId} --no-cluster=true`, - dotnet: `inf bootstrap dotnet --dir=inferable-app-${clusterId} --no-cluster=true`, + node: `inf bootstrap node --dir=inferable-app-${clusterId}`, + golang: `inf bootstrap go --dir=inferable-app-${clusterId}`, + dotnet: `inf bootstrap dotnet --dir=inferable-app-${clusterId}`, }; return `${baseCommands} && \\ diff --git a/cli/src/commands/bootstrap.ts b/cli/src/commands/bootstrap.ts index dffba861..4fd4cdc0 100644 --- a/cli/src/commands/bootstrap.ts +++ b/cli/src/commands/bootstrap.ts @@ -16,7 +16,6 @@ const execAsync = promisify(exec); interface BootstrapArgs { dir?: string; type?: string; - "no-cluster"?: boolean; } const projectMap: Record< @@ -60,11 +59,6 @@ export const Bootstrap: CommandModule<{}, BootstrapArgs> = { describe: "Directory to create the application in", type: "string", demandOption: false, - }) - .option("no-cluster", { - describe: "Do not provision a new cluster", - type: "boolean", - demandOption: false, }), handler: async ({ dir: providedDir, @@ -83,18 +77,6 @@ export const Bootstrap: CommandModule<{}, BootstrapArgs> = { }, ]); - const { cluster } = - noCluster === undefined - ? await inquirer.prompt([ - { - type: "confirm", - name: "cluster", - message: "Would you like to provision a new cluster?", - default: true, - }, - ]) - : { cluster: !noCluster }; - const { dir } = providedDir === undefined ? await inquirer.prompt([ @@ -113,63 +95,6 @@ export const Bootstrap: CommandModule<{}, BootstrapArgs> = { console.log(`Downloading ${proxyRepo.url}...`); await downloadProject(proxyRepo.url, proxyRepo.ref, dir); - if (cluster) { - if (!getToken()) { - console.log( - "To prevent abuse to our systems, we request that users verify their email address. Press Enter to continue...", - ); - - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }); - - try { - await new Promise((resolve) => { - rl.question("", () => { - resolve(); - }); - }); - } finally { - rl.close(); - } - - await startTokenFlow(); - } - - console.log("Creating Cluster... "); - - const newCluster = await createCluster({ - description: `CLI Created Cluster at ${new Date().toISOString()}`, - }); - - if (!newCluster) { - console.log("Failed to create cluster"); - process.exit(1); - } - - console.log("Cluster created with ID:", newCluster?.id); - - console.log("Creating API key..."); - - const newApiKey = await createApiKey( - newCluster?.id, - `CLI Created API Key`, - ); - - if (!newApiKey) { - console.log("Failed to create API key"); - process.exit(1); - } - - const envFile = path.resolve(dir, ".env"); - - await appendFile(envFile, `INFERABLE_API_SECRET=${newApiKey.key}\n`); - await appendFile(envFile, `INFERABLE_CLUSTER_ID=${newCluster.id}\n`); - - console.log("API Key created with ID:", newApiKey?.id); - } - switch (type) { case "proxy": case "node":