Skip to content

Commit

Permalink
feedback from Ben
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd authored and azure-sdk committed Nov 5, 2024
1 parent 6e27cc5 commit 2259315
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,24 @@ class PackageProps {
}

[void]InitializeCIArtifacts() {
if ($env:TF_BUILD -or $env:GITHUB_ACTIONS) {
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..")

$ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "sdk" $this.ServiceDirectory)
$ciFiles = Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File

if (-not $this.ArtifactDetails) {
foreach ($ciFile in $ciFiles) {
$ciArtifactResult = $this.ParseYmlForArtifact($ciFile.FullName)
if ($ciArtifactResult) {
$this.ArtifactDetails = [Hashtable]$ciArtifactResult.ArtifactConfig
$this.CIMatrixConfigs = $ciArtifactResult.MatrixConfigs
# if this package appeared in this ci file, then we should
# treat this CI file as the source of the Matrix for this package
break
}
if ($env:SYSTEM_TEAMPROJECTID -or $env:GITHUB_ACTIONS) {
return
}

$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..")

$ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "sdk" $this.ServiceDirectory)
$ciFiles = Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File

if (-not $this.ArtifactDetails) {
foreach ($ciFile in $ciFiles) {
$ciArtifactResult = $this.ParseYmlForArtifact($ciFile.FullName)
if ($ciArtifactResult) {
$this.ArtifactDetails = [Hashtable]$ciArtifactResult.ArtifactConfig
$this.CIMatrixConfigs = $ciArtifactResult.MatrixConfigs
# if this package appeared in this ci file, then we should
# treat this CI file as the source of the Matrix for this package
break
}
}
}
Expand Down

0 comments on commit 2259315

Please sign in to comment.