From ca37fcfafd24a9d72f6517a3359781a15dfb3413 Mon Sep 17 00:00:00 2001 From: aminya Date: Fri, 10 Jul 2020 19:43:16 -0500 Subject: [PATCH] cache template --- script/vsts/platforms/cache.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 script/vsts/platforms/cache.yml diff --git a/script/vsts/platforms/cache.yml b/script/vsts/platforms/cache.yml new file mode 100644 index 00000000000..3b1306b7248 --- /dev/null +++ b/script/vsts/platforms/cache.yml @@ -0,0 +1,30 @@ +parameters: + - name: OS + displayName: Operating System + type: string + values: + - windows + - linux + - macos + +steps: + - task: Cache@2 + displayName: Cache node_modules + inputs: + key: 'npm | "$(Agent.OS)" | "$(buildArch)" | package.json, package-lock.json, script/vsts/platforms/{{ parameters.OS }}.yml' + path: 'node_modules' + cacheHitVar: MainNodeModulesRestored + + - task: Cache@2 + displayName: Cache script/node_modules + inputs: + key: 'npm | "$(Agent.OS)" | "$(buildArch)" | script/package.json, script/package-lock.json, script/vsts/platforms/{{ parameters.OS }}.yml' + path: 'script/node_modules' + cacheHitVar: ScriptNodeModulesRestored + + - task: Cache@2 + displayName: Cache apm/node_modules + inputs: + key: 'npm | "$(Agent.OS)" | "$(buildArch)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/{{ parameters.OS }}.yml' + path: 'apm/node_modules' + cacheHitVar: ApmNodeModulesRestored