2
2
const { spawnProcess } = require ( "../utils/spawn-process" ) ;
3
3
const path = require ( "path" ) ;
4
4
5
- const runTurbo = async ( task , args , apiSecret , apiEndpoint ) => {
5
+ const runTurbo = async ( task , args , { apiSecret, apiEndpoint, apiSignatureKey } = { } ) => {
6
6
const command = [ "turbo" , "run" , task , "--concurrency=100%" , "--output-logs=hash-only" ] ;
7
7
command . push ( ...args ) ;
8
8
const turboRoot = path . join ( __dirname , ".." , ".." ) ;
@@ -14,8 +14,10 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
14
14
...process . env ,
15
15
TURBO_TELEMETRY_DISABLED : "1" ,
16
16
...( apiSecret &&
17
- apiEndpoint && {
17
+ apiEndpoint &&
18
+ apiSignatureKey && {
18
19
TURBO_API : apiEndpoint ,
20
+ TURBO_REMOTE_CACHE_SIGNATURE_KEY : apiSignatureKey ,
19
21
TURBO_TOKEN : apiSecret ,
20
22
TURBO_TEAM : "aws-sdk-js" ,
21
23
} ) ,
@@ -36,13 +38,14 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
36
38
const main = async ( ) => {
37
39
const apiSecret = process . env . AWS_JSV3_TURBO_CACHE_API_SECRET ;
38
40
const apiEndpoint = process . env . AWS_JSV3_TURBO_CACHE_API_ENDPOINT ;
41
+ const apiSignatureKey = process . env . AWS_JSV3_TURBO_CACHE_API_SIGNATURE_KEY ;
39
42
40
43
const args = process . argv . slice ( 2 ) ;
41
44
42
- if ( ! apiSecret || ! apiEndpoint ) {
45
+ if ( ! apiSecret || ! apiEndpoint || ! apiSignatureKey ) {
43
46
await runTurbo ( args [ 0 ] , args . slice ( 1 ) ) ;
44
47
} else {
45
- await runTurbo ( args [ 0 ] , args . slice ( 1 ) , apiSecret , apiEndpoint ) ;
48
+ await runTurbo ( args [ 0 ] , args . slice ( 1 ) , { apiSecret, apiEndpoint, apiSignatureKey } ) ;
46
49
}
47
50
} ;
48
51
0 commit comments