Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append _Attempt$(System.JobAttempt) to artifact name on failure #46064

Merged
merged 9 commits into from
Jan 17, 2025
27 changes: 23 additions & 4 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ jobs:
- name: artifactsStagingDir
value: $(Build.ArtifactStagingDirectory)/artifacts

- name: successfulJobArtifactName
value: $(Agent.JobName)_Artifacts

- name: failedJobArtifactName
value: $(Agent.JobName)_Artifacts_Attempt$(System.JobAttempt)
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved

# manually disable CodeQL until https://dev.azure.com/mseng/1ES/_workitems/edit/2211548 is implemented
# CodeQL doesn't work on arm64 macOS, see https://portal.microsofticm.com/imp/v5/incidents/details/532165079/summary
- ${{ if eq(parameters.pool.os, 'macOS') }}:
Expand All @@ -205,9 +211,16 @@ jobs:

- output: pipelineArtifact
path: $(artifactsStagingDir)
artifact: $(Agent.JobName)_Artifacts
artifact: $(successfulJobArtifactName)
displayName: Publish Artifacts
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved
condition: succeededOrFailed()
condition: succeeded()
sbomEnabled: true

- output: pipelineArtifact
path: $(artifactsStagingDir)
artifact: $(failedJobArtifactName)
displayName: Publish Artifacts
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved
condition: failed()
sbomEnabled: true

# Using build artifacts to enable publishing the vertical manifests to a single artifact from different jobs
Expand Down Expand Up @@ -603,9 +616,15 @@ jobs:

- ${{ if or(ne(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'PullRequest')) }}:
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved
- publish: $(artifactsStagingDir)
artifact: $(Agent.JobName)_Artifacts
artifact: $(successfulJobArtifactName)
displayName: Publish Artifacts
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved
condition: succeededOrFailed()
condition: succeeded()
continueOnError: true

- publish: $(artifactsStagingDir)
artifact: $(failedJobArtifactName)
displayName: Publish Artifacts
ellahathaway marked this conversation as resolved.
Show resolved Hide resolved
condition: failed()
continueOnError: true

# Using build artifacts to enable publishing the vertical manifests to a single artifact from different jobs
Expand Down
Loading