Skip to content

Commit 262eede

Browse files
authored
[Storage] Try azurite cache. (Azure#20660)
* try this. * fix yaml. * try this ? * Revert "try this ?" This reverts commit db60ad3. * does this work ?? * ... * ... * try this. * skip npm step if restored from cache.
1 parent 3c9dbe1 commit 262eede

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1+
parameters:
2+
- name: AzuriteLocation
3+
type: string
4+
default: $(Pipeline.Workspace)/.storage/azurite
5+
- name: AzuriteVersion
6+
type: string
7+
default: 3.11.0
8+
19
steps:
10+
- task: Cache@2
11+
inputs:
12+
key: storageazurite | "$(Agent.OS)" | "${{ parameters.AzuriteVersion }}"
13+
path: ${{ parameters.AzuriteLocation }}
14+
cacheHitVar: STORAGE_AZURITE_CACHE_RESTORED
15+
displayName: Cache Azurite instalation
216
- task: Npm@1
317
inputs:
418
command: custom
5-
customCommand: install --prefix $(Agent.TempDirectory)/azurite azurite
19+
customCommand: install --prefix ${{ parameters.AzuriteLocation }} azurite@${{ parameters.AzuriteVersion }}
20+
condition: ne(variables.STORAGE_AZURITE_CACHE_RESTORED, 'true')
621
displayName: Install Azurite
722
- task: PowerShell@2
823
displayName: Add Azurite location as environment variable
924
inputs:
1025
targetType: 'inline'
11-
script: Write-Host "##vso[task.setvariable variable=Azure.Azurite.Location;]$(Agent.TempDirectory)/azurite"
26+
script: Write-Host "##vso[task.setvariable variable=Azure.Azurite.Location;]${{ parameters.AzuriteLocation }}"

0 commit comments

Comments
 (0)