Skip to content

Commit

Permalink
chore(build): set cache read/write based on build type
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Jan 28, 2025
1 parent f9e0982 commit 0190e5c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/turbo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@ const path = require("path");

const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => {
const command = ["turbo", "run", task, "--concurrency=100%", "--output-logs=hash-only"];

const cacheReadWriteKey = process.env.AWS_JSV3_TURBO_CACHE_BUILD_TYPE ?? "dev";

const cacheReadWrite = {
// release is remote write-only
RELEASE: "--cache=local:,remote:w",
// preview is remote read/write
PREVIEW: "--cache=local:,remote:rw",
// dev is local read/write and remote read-only
dev: "--cache=local:rw,remote:r",
};

command.push(cacheReadWrite[cacheReadWriteKey]);
command.push(...args);

const turboRoot = path.join(__dirname, "..", "..");

const turboEnv = {
Expand Down

0 comments on commit 0190e5c

Please sign in to comment.