Skip to content

Commit

Permalink
Add retries to Node and Rush install tasks (#2483)
Browse files Browse the repository at this point in the history
- Partially fixes Azure/typespec-azure#3630
  • Loading branch information
mikeharder authored Sep 25, 2023
1 parent 9a2a1bf commit 052d0b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
8 changes: 1 addition & 7 deletions eng/pipelines/jobs/pull-request-consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ steps:
- checkout: self
submodules: true

- task: NodeTool@0
inputs:
versionSpec: "16.x"
displayName: Install Node.js

- script: node common/scripts/install-run-rush.js install --max-install-attempts 3
displayName: Install JavaScript Dependencies
- template: ../templates/install.yml

- script: node common/scripts/install-run-rush.js change -v
condition: and(succeeded(), not(or(startsWith(variables['System.PullRequest.SourceBranch'], 'publish/'), startsWith(variables['System.PullRequest.SourceBranch'], 'backmerge/'))))
Expand Down
8 changes: 1 addition & 7 deletions eng/pipelines/pr-tryit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ jobs:
- checkout: self
persistCredentials: true

- task: NodeTool@0
inputs:
versionSpec: 16.x
displayName: Install Node.js

- script: node common/scripts/install-run-rush.js install --max-install-attempts 3
displayName: Install JavaScript Dependencies
- template: ./templates/install.yml

- template: ./templates/build.yml

Expand Down
5 changes: 4 additions & 1 deletion eng/pipelines/templates/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ steps:
inputs:
versionSpec: ${{ parameters.nodeVersion }}
displayName: Install Node.js
retryCountOnTaskFailure: 3

- task: UseDotNet@2
inputs:
Expand All @@ -23,8 +24,10 @@ steps:
dotnet --version
displayName: "Log tool versions used"
- script: node common/scripts/install-run-rush.js install --max-install-attempts 3
# purge before install to ensure a clean state between retries
- script: node common/scripts/install-run-rush.js install --purge
displayName: Install JavaScript Dependencies
retryCountOnTaskFailure: 3

- script: dotnet restore
displayName: Restore .NET Dependencies
Expand Down

0 comments on commit 052d0b4

Please sign in to comment.