seed tasks with the machine preset if listed in the config

This commit is contained in:
Eric Allam
2024-08-19 09:51:35 +01:00
committed by Eric Allam
parent a7fa91f1d8
commit cc8eb34e10
@@ -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 };