From 5b3bc2f7bcf89869d3545961659a4fd90e6e67c5 Mon Sep 17 00:00:00 2001 From: Dmitry Kurmanov Date: Fri, 28 Jul 2023 19:23:01 +0300 Subject: [PATCH] attempt to fix npm cache problem (separate task) --- build-packages.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/build-packages.yml b/build-packages.yml index f770f93e45..e8a731fc05 100644 --- a/build-packages.yml +++ b/build-packages.yml @@ -32,7 +32,38 @@ pool: jobs: +- job: NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "14.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - job: CoreAngularJquery + dependsOn: + - NPMCache steps: - checkout: self @@ -138,6 +169,9 @@ jobs: - job: Knockout + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo @@ -244,6 +278,8 @@ jobs: - job: React + dependsOn: + - NPMCache steps: - checkout: self @@ -345,6 +381,8 @@ jobs: - job: Vue + dependsOn: + - NPMCache steps: - checkout: self @@ -445,6 +483,9 @@ jobs: publishLocation: "Container" - job: Angular + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo @@ -560,6 +601,9 @@ jobs: publishLocation: "Container" - job: Vue3 + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo