diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 93c0e111f0d38..56a18caef6407 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -11064,7 +11064,8 @@ let run = exports.run = (() => { e: 'exclude', h: 'help', i: 'include' - } + }, + boolean: ['prefer-offline', 'frozen-lockfile'] }); const args = options._; if (options.help || args.length === 0) { @@ -12199,8 +12200,7 @@ const BootstrapCommand = exports.BootstrapCommand = { batchByWorkspace: true }); const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - const frozenLockfile = options['frozen-lockfile'] === true; - const extraArgs = frozenLockfile ? ['--frozen-lockfile'] : []; + const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; _log.log.write(_chalk2.default.bold('\nRunning installs in topological order:')); for (const batch of batchedProjectsByWorkspace) { for (const project of batch) { diff --git a/packages/kbn-pm/src/cli.ts b/packages/kbn-pm/src/cli.ts index 07383f89b8165..d7e3aafd13fce 100644 --- a/packages/kbn-pm/src/cli.ts +++ b/packages/kbn-pm/src/cli.ts @@ -65,6 +65,7 @@ export async function run(argv: string[]) { h: 'help', i: 'include', }, + boolean: ['prefer-offline', 'frozen-lockfile'], }); const args = options._; diff --git a/packages/kbn-pm/src/commands/bootstrap.ts b/packages/kbn-pm/src/commands/bootstrap.ts index 2469e4cca1cb1..be4b9da7bf516 100644 --- a/packages/kbn-pm/src/commands/bootstrap.ts +++ b/packages/kbn-pm/src/commands/bootstrap.ts @@ -35,8 +35,10 @@ export const BootstrapCommand: ICommand = { }); const batchedProjects = topologicallyBatchProjects(projects, projectGraph); - const frozenLockfile = options['frozen-lockfile'] === true; - const extraArgs = frozenLockfile ? ['--frozen-lockfile'] : []; + const extraArgs = [ + ...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), + ...(options['prefer-offline'] === true ? ['--prefer-offline'] : []), + ]; log.write(chalk.bold('\nRunning installs in topological order:')); diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh index 5a8738018b681..71f8b10513e5e 100755 --- a/src/dev/ci_setup/setup.sh +++ b/src/dev/ci_setup/setup.sh @@ -84,6 +84,11 @@ hash -r yarnVersion="$(node -e "console.log(String(require('./package.json').engines.yarn || '').replace(/^[^\d]+/,''))")" npm install -g yarn@^${yarnVersion} +### +### setup yarn offline cache +### +yarn config set yarn-offline-mirror "$cacheDir/yarn-offline-cache" + ### ### "install" yarn into this shell ### @@ -95,7 +100,7 @@ hash -r ### install dependencies ### echo " -- installing node.js dependencies" -yarn kbn bootstrap +yarn kbn bootstrap --prefer-offline ### ### verify no git modifications