@@ -4,7 +4,22 @@ const path = require("path");
4
4
5
5
const runTurbo = async ( task , args , { apiSecret, apiEndpoint, apiSignatureKey } = { } ) => {
6
6
const command = [ "turbo" , "run" , task , "--concurrency=100%" , "--output-logs=hash-only" ] ;
7
+
8
+ const cacheReadWriteKey = process . env . AWS_JSV3_TURBO_CACHE_BUILD_TYPE ?? "dev" ;
9
+
10
+ const cacheReadWrite = {
11
+ // Release is remote write-only.
12
+ // Every release has unique artifacts and should not read from the cache.
13
+ RELEASE : "--cache=local:,remote:w" ,
14
+ // preview is remote read/write
15
+ PREVIEW : "--cache=local:,remote:rw" ,
16
+ // dev is local read/write and remote read-only
17
+ dev : "--cache=local:rw,remote:r" ,
18
+ } ;
19
+
20
+ command . push ( cacheReadWrite [ cacheReadWriteKey ] ) ;
7
21
command . push ( ...args ) ;
22
+
8
23
const turboRoot = path . join ( __dirname , ".." , ".." ) ;
9
24
10
25
const turboEnv = {
@@ -18,9 +33,6 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey }
18
33
TURBO_TOKEN : apiSecret ,
19
34
TURBO_TEAM : "aws-sdk-js" ,
20
35
} ) ,
21
- ...( ! process . env . CODEBUILD_BUILD_ARN && {
22
- TURBO_REMOTE_CACHE_READ_ONLY : "1" ,
23
- } ) ,
24
36
} ;
25
37
26
38
try {
0 commit comments