From f15e5a706bc6bb756d3ae66a422baf188aefdb78 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 26 Jun 2019 11:17:26 +0200 Subject: [PATCH] use yarn --frozen-lockfile for builds --- build/azure-pipelines/darwin/continuous-build-darwin.yml | 2 +- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- build/azure-pipelines/linux/continuous-build-linux.yml | 2 +- .../azure-pipelines/linux/product-build-linux-alpine.yml | 2 +- build/azure-pipelines/linux/product-build-linux-arm.yml | 2 +- build/azure-pipelines/linux/product-build-linux.yml | 2 +- build/azure-pipelines/win32/continuous-build-win32.yml | 2 +- build/azure-pipelines/win32/product-build-win32.yml | 2 +- build/npm/postinstall.js | 9 +++------ 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/build/azure-pipelines/darwin/continuous-build-darwin.yml b/build/azure-pipelines/darwin/continuous-build-darwin.yml index 776c1172bea..d84beb2e597 100644 --- a/build/azure-pipelines/darwin/continuous-build-darwin.yml +++ b/build/azure-pipelines/darwin/continuous-build-darwin.yml @@ -11,7 +11,7 @@ steps: inputs: versionSpec: "1.10.1" - script: | - yarn + yarn --frozen-lockfile displayName: Install Dependencies condition: ne(variables['CacheRestored'], 'true') - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 0b9a362c075..5cb5d7243d2 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -37,7 +37,7 @@ steps: - script: | set -e - yarn + yarn --frozen-lockfile displayName: Install dependencies - script: | diff --git a/build/azure-pipelines/linux/continuous-build-linux.yml b/build/azure-pipelines/linux/continuous-build-linux.yml index ee47a8d4320..bce42a665fe 100644 --- a/build/azure-pipelines/linux/continuous-build-linux.yml +++ b/build/azure-pipelines/linux/continuous-build-linux.yml @@ -19,7 +19,7 @@ steps: inputs: versionSpec: "1.10.1" - script: | - yarn + yarn --frozen-lockfile displayName: Install Dependencies condition: ne(variables['CacheRestored'], 'true') - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 diff --git a/build/azure-pipelines/linux/product-build-linux-alpine.yml b/build/azure-pipelines/linux/product-build-linux-alpine.yml index 107f7fa0cec..5bce791dcf6 100644 --- a/build/azure-pipelines/linux/product-build-linux-alpine.yml +++ b/build/azure-pipelines/linux/product-build-linux-alpine.yml @@ -46,7 +46,7 @@ steps: - script: | set -e - CHILD_CONCURRENCY=1 yarn + CHILD_CONCURRENCY=1 yarn --frozen-lockfile displayName: Install dependencies - script: | diff --git a/build/azure-pipelines/linux/product-build-linux-arm.yml b/build/azure-pipelines/linux/product-build-linux-arm.yml index ffa6d18f68e..6aac72535bc 100644 --- a/build/azure-pipelines/linux/product-build-linux-arm.yml +++ b/build/azure-pipelines/linux/product-build-linux-arm.yml @@ -46,7 +46,7 @@ steps: - script: | set -e - CHILD_CONCURRENCY=1 yarn + CHILD_CONCURRENCY=1 yarn --frozen-lockfile displayName: Install dependencies - script: | diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 210798a4776..a93dd8edd0d 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -38,7 +38,7 @@ steps: - script: | set -e - CHILD_CONCURRENCY=1 yarn + CHILD_CONCURRENCY=1 yarn --frozen-lockfile displayName: Install dependencies - script: | diff --git a/build/azure-pipelines/win32/continuous-build-win32.yml b/build/azure-pipelines/win32/continuous-build-win32.yml index 36336276814..85d648e8f41 100644 --- a/build/azure-pipelines/win32/continuous-build-win32.yml +++ b/build/azure-pipelines/win32/continuous-build-win32.yml @@ -15,7 +15,7 @@ steps: targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: '$(ArtifactFeed)' - powershell: | - yarn + yarn --frozen-lockfile displayName: Install Dependencies condition: ne(variables['CacheRestored'], 'true') - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index 6efaa050dcc..06c6342b81e 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -40,7 +40,7 @@ steps: $ErrorActionPreference = "Stop" $env:npm_config_arch="$(VSCODE_ARCH)" $env:CHILD_CONCURRENCY="1" - exec { yarn } + exec { yarn --frozen-lockfile } displayName: Install dependencies - powershell: | diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index edc5e35ade3..80a4f0eeb5c 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -20,13 +20,10 @@ function yarnInstall(location, opts) { const raw = process.env['npm_config_argv'] || '{}'; const argv = JSON.parse(raw); const original = argv.original || []; - const args = ['install']; + const args = original.filter(arg => arg === '--ignore-optional' || arg === '--frozen-lockfile'); - if (original.indexOf('--ignore-optional') > -1) { - args.push('--ignore-optional'); - } - - console.log('Installing dependencies in \'%s\'.', location); + console.log(`Installing dependencies in ${location}...`); + console.log(`$ yarn ${args.join(' ')}`); const result = cp.spawnSync(yarn, args, opts); if (result.error || result.status !== 0) { -- GitLab