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

Sync eng/common directory with azure-sdk-tools for PR 7810 #22526

Merged
merged 5 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
value: $[ coalesce(variables.jobMatrixFilter, '.*') ]
pool:
name: ${{ parameters.Pool }}
vmImage: ${{ parameters.OsVmImage }}
image: ${{ parameters.OsVmImage }}
os: ${{ parameters.Os }}
${{ if parameters.DependsOn }}:
dependsOn: ${{ parameters.DependsOn }}
Expand Down
24 changes: 13 additions & 11 deletions eng/common/pipelines/templates/steps/publish-1es-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
# ArtifactName - The name of the artifact in the "successful" case.
# ArtifactPath - The path we will be publishing.
# CustomCondition - Used if there is additional logic necessary to prevent attempt of publish.
# SbomEnabled - Set whether to auto-inject 1es pipeline template sbom tasks

parameters:
ArtifactName: ''
ArtifactPath: ''
CustomCondition: true
SbomEnabled: true

steps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}"
condition: and(succeeded(), ${{ parameters.CustomCondition }})
displayName: Set Artifact Name

- pwsh: |
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)"
condition: and(failed(), ${{ parameters.CustomCondition }})
displayName: Set Failed Artifact Name
if ($env:AGENT_JOBSTATUS -eq "Failed") {
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)"
} else {
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}"
}
condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }})
displayName: Set Artifact Name $(Agent.JobStatus)

- task: 1ES.PublishPipelineArtifact@1
condition: and(succeeded(), ${{ parameters.CustomCondition }})
condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }})
displayName: 'Publish ${{ parameters.ArtifactName }} Artifacts'
inputs:
artifact: '$(PublishArtifactName)'
path: '${{ parameters.ArtifactPath }}'
artifactName: '$(PublishArtifactName)'
targetPath: '${{ parameters.ArtifactPath }}'
sbomEnabled: ${{ parameters.SbomEnabled }}
4 changes: 2 additions & 2 deletions eng/common/scripts/Verify-AgentOS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ function Throw-InvalidOperatingSystem {

if ($IsWindows -and $AgentImage -match "windows|win|MMS\d{4}") {
$osName = "Windows"
} elseif ($IsLinux -and $AgentImage -match "ubuntu") {
} elseif ($IsLinux -and $AgentImage -match "ubuntu|linux") {
$osName = "Linux"
} elseif ($IsMacOs -and $AgentImage -match "macos") {
} elseif ($IsMacOs -and $AgentImage -match "macos|macOS") {
$osName = "macOS"
} else {
Throw-InvalidOperatingSystem
Expand Down