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

Disable InitializeCIArtifacts on Non-CI Builds #9330

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Changes from 1 commit
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
30 changes: 16 additions & 14 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,22 @@ class PackageProps {
}

[void]InitializeCIArtifacts() {
$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:TF_BUILD -or $env:GITHUB_ACTIONS) {
scbedd marked this conversation as resolved.
Show resolved Hide resolved
$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