Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions scripts/turbo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { spawnProcess } = require("../utils/spawn-process");
const path = require("path");

const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => {
const command = ["turbo", "run", task, "--concurrency=100%", "--output-logs=hash-only"];
command.push(...args);
const turboRoot = path.join(__dirname, "..", "..");
Expand All @@ -14,8 +14,10 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
...process.env,
TURBO_TELEMETRY_DISABLED: "1",
...(apiSecret &&
apiEndpoint && {
apiEndpoint &&
apiSignatureKey && {
TURBO_API: apiEndpoint,
TURBO_REMOTE_CACHE_SIGNATURE_KEY: apiSignatureKey,
TURBO_TOKEN: apiSecret,
TURBO_TEAM: "aws-sdk-js",
}),
Expand All @@ -36,13 +38,14 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
const main = async () => {
const apiSecret = process.env.AWS_JSV3_TURBO_CACHE_API_SECRET;
const apiEndpoint = process.env.AWS_JSV3_TURBO_CACHE_API_ENDPOINT;
const apiSignatureKey = process.env.AWS_JSV3_TURBO_CACHE_API_SIGNATURE_KEY;

const args = process.argv.slice(2);

if (!apiSecret || !apiEndpoint) {
if (!apiSecret || !apiEndpoint || !apiSignatureKey) {
await runTurbo(args[0], args.slice(1));
} else {
await runTurbo(args[0], args.slice(1), apiSecret, apiEndpoint);
await runTurbo(args[0], args.slice(1), { apiSecret, apiEndpoint, apiSignatureKey });
}
};

Expand Down
4 changes: 3 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "https://turbo.build/schema.json",
"remoteCache": {},
"remoteCache": {
"signature": true
},
"tasks": {
"build": {
"outputs": ["dist-types/**", "dist-cjs/**", "dist-es/**"],
Expand Down
Loading