From cc8eb34e102d8c7ef7cbe680c8007634d30535fc Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Mon, 19 Aug 2024 09:51:35 +0100 Subject: [PATCH] seed tasks with the machine preset if listed in the config --- .../cli-v3/src/entryPoints/deploy-indexer.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/cli-v3/src/entryPoints/deploy-indexer.ts b/packages/cli-v3/src/entryPoints/deploy-indexer.ts index ccd2c3d39..f9813a9b7 100644 --- a/packages/cli-v3/src/entryPoints/deploy-indexer.ts +++ b/packages/cli-v3/src/entryPoints/deploy-indexer.ts @@ -155,7 +155,23 @@ async function indexDeployment({ throw new Error(`Failed to index task files:\n${errorMessages.join("\n")}`); } - const tasks = taskCatalog.listTaskManifests(); + let tasks = taskCatalog.listTaskManifests(); + + if (typeof config.machine === "string") { + // Set the machine preset on all tasks that don't have it + tasks = tasks.map((task) => { + if (typeof task.machine?.preset !== "string") { + return { + ...task, + machine: { + preset: config.machine, + }, + }; + } + + return task; + }); + } const workerManifest: WorkerManifest = { tasks, configPath: buildManifest.configPath };