Skip to content

Commit

Permalink
Reduce lerna concurrency in runTo (#15173)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 authored Sep 23, 2020
1 parent 61cabfb commit d792de0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/monorepo/runTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { spawnSync } = require('child_process');
const lernaBin = require.resolve('lerna/cli.js');
const getAllPackageInfo = require('./getAllPackageInfo');
const os = require('os');

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

Expand Down Expand Up @@ -68,7 +69,18 @@ function runTo(script, projects, rest) {
// --stream allows the build to proceed in parallel but still in order
spawnSync(
process.execPath,
[lernaBin, 'run', script, ...scopes, '--include-filtered-dependencies', '--stream', '--', ...rest],
[
lernaBin,
'run',
script,
...scopes,
'--include-filtered-dependencies', // makes the build include dependencies
'--stream', // run in parallel but still in order
// Except when running in PR/CI, reduce concurrency so the computer is usable while building
...(process.env.TF_BUILD ? [] : ['--concurrency=' + (os.cpus().length - 2)]),
'--',
...rest,
],
{
stdio: 'inherit',
},
Expand Down

0 comments on commit d792de0

Please sign in to comment.