-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move turbo outside of build for docker swc builds (#54035)
removes usage of turbo and uses the default node version inside the image.
- Loading branch information
Showing
2 changed files
with
68 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env node | ||
// @ts-check | ||
|
||
const { execSync } = require('child_process') | ||
|
||
;(async function () { | ||
const target = process.argv[process.argv.length - 1] | ||
|
||
const turboResult = execSync( | ||
`pnpm turbo run cache-build-native --dry=json -- ${target}` | ||
).toString() | ||
|
||
const turboData = JSON.parse(turboResult) | ||
|
||
const task = turboData.tasks.find((t) => t.command !== '<NONEXISTENT>') | ||
|
||
if (!task) { | ||
console.warn(`Failed to find related turbo task`, turboResult) | ||
return | ||
} | ||
|
||
// pull cache if it was available | ||
if (task.cache.local || task.cache.remote) { | ||
const pullResult = execSync( | ||
`pnpm turbo run cache-build-native -- ${target}` | ||
).toString() | ||
console.log(pullResult) | ||
} else { | ||
console.warn(`No turbo cache was available, continuing...`) | ||
console.warn(task) | ||
} | ||
})() |