From 587c053717318869abd1c511202a8f3e0305f3a5 Mon Sep 17 00:00:00 2001 From: Isaiah Hall Date: Fri, 2 Aug 2024 17:13:01 -0400 Subject: [PATCH] chore(turbo): updated Turbo version --- scripts/turbo/index.js | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/scripts/turbo/index.js b/scripts/turbo/index.js index 69050bc84180..214e2a63ff05 100644 --- a/scripts/turbo/index.js +++ b/scripts/turbo/index.js @@ -1,40 +1,13 @@ -const fs = require("fs"); +// Build script to handle Turborepo build execution const { spawnProcess } = require("../utils/spawn-process"); const path = require("path"); -// Fetch Secrets In CI Environments -const fetchSecret = async (secretName) => { - const account = process.env.TURBO_CACHE_AWS_ACCOUNT_ID; - if (!account) { - return null; - } - try { - if (!fs.existsSync(path.join(__dirname, "node_modules/"))) { - await installDeps(); - } - const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager"); - const partialArn = `arn:aws:secretsmanager:us-west-2:${account}:secret:${secretName}`; - const secretsManager = new SecretsManagerClient({ region: "us-west-2" }); - const command = new GetSecretValueCommand({ SecretId: partialArn }); - - const response = await secretsManager.send(command); - return response.SecretString; - } catch (error) { - console.error("Error fetching turbo remote cache secret:", error); - return null; - } -}; - -const installDeps = async () => { - return spawnProcess("npm", ["install"], { stdio: "inherit", cwd: __dirname }); -}; - const runTurbo = async (task, args, apiSecret, apiEndpoint) => { let command = ["turbo", "run", task]; if (apiSecret && apiEndpoint) { command = command.concat([ `--api=${apiEndpoint}`, - `--team=aws-sdk-js`, + "--team=aws-sdk-js", `--token=${apiSecret}`, "--concurrency=100%", ]); @@ -49,8 +22,8 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => { }; const main = async () => { - const apiSecret = process.env.AWS_JS3_TURBO_CACHE_API_SECRET || (await fetchSecret("TURBO_CACHE_API_SECRET")); - const apiEndpoint = process.env.AWS_JS3_TURBO_CACHE_API_ENDPOINT || (await fetchSecret("TURBO_CACHE_API_ENDPOINT")); + const apiSecret = process.env.AWS_JSV3_TURBO_CACHE_API_SECRET; + const apiEndpoint = process.env.AWS_JSV3_TURBO_CACHE_API_ENDPOINT; const args = process.argv.slice(2);