Skip to content

Commit 752aff1

Browse files
committed
Test ESRP idempotency
1 parent 218ebc2 commit 752aff1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

eng/pipelines/templates/stages/archetype-rust-release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ stages:
9191
$ArtifactRootPath = '$(Pipeline.Workspace)/drop'
9292
$OutDir = '$(Pipeline.Workspace)/esrp-release'
9393
94-
Write-Host "Cleaning output directory: $OutDir"
9594
if (Test-Path $OutDir) {
95+
Write-Host "Cleaning output directory: $OutDir"
9696
Remove-Item -Path $OutDir -Recurse -Force
9797
}
9898
New-Item -ItemType Directory -Path $OutDir -Force | Out-Null
@@ -116,7 +116,7 @@ stages:
116116
Write-Host "Contents of $OutDir"
117117
Get-ChildItem -Path $OutDir | ForEach-Object { Write-Host $_.FullName }
118118
displayName: 'Copy crate for ESRP: ${{artifact.name}}'
119-
119+
120120
- task: EsrpRelease@10
121121
displayName: 'ESRP Release: ${{artifact.name}}'
122122
inputs:
@@ -135,6 +135,15 @@ stages:
135135
approvers: ${{ coalesce(variables['Build.RequestedForEmail'], '[email protected]') }}
136136
serviceendpointurl: 'https://api.esrp.microsoft.com/'
137137
mainpublisher: 'ESRPRELPACMANTEST'
138+
139+
- pwsh: |
140+
Write-Host "Fail if it's the first attempt..."
141+
if ('$(System.JobAttempt)' -eq '1') {
142+
Write-Host "Failing job on the first attempt"
143+
exit 1
144+
}
145+
Write-Host "Not the first attempt, continuing..."
146+
displayName: 'Fail first attempt to test retry behavior'
138147
139148
- job: UpdatePackageVersion
140149
displayName: "API Review and Package Version Update"

0 commit comments

Comments
 (0)