Skip to content

Commit

Permalink
Merge remote-tracking branch 'libtemplate/main' into azp
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Jan 29, 2024
2 parents 7109b71 + 9466f8e commit bce336a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions azure-pipelines/artifacts/_pipelines.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[CmdletBinding()]
param (
[string]$ArtifactNameSuffix,
[switch]$StageOnly
[switch]$StageOnly,
[switch]$AvoidSymbolicLinks
)

Function Set-PipelineVariable($name, $value) {
Expand All @@ -24,7 +25,7 @@ Function Test-ArtifactUploaded($artifactName) {
Test-Path "env:$varName"
}

& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix |% {
& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% {
# Set a variable which will out-live this script so that a subsequent attempt to collect and upload artifacts
# will skip this one from a check in the _all.ps1 script.
Set-PipelineVariable "ARTIFACTSTAGED_$($_.Name.ToUpper())" 'true'
Expand Down
10 changes: 8 additions & 2 deletions azure-pipelines/artifacts/_stage_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

[CmdletBinding()]
param (
[string]$ArtifactNameSuffix
[string]$ArtifactNameSuffix,
[switch]$AvoidSymbolicLinks
)

$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal
Expand Down Expand Up @@ -48,7 +49,12 @@ $Artifacts |% {

if (-not (Test-Path $DestinationFolder)) { New-Item -ItemType Directory -Path $DestinationFolder | Out-Null }
if (Test-Path -PathType Leaf $_.Source) { # skip folders
Create-SymbolicLink -Link (Join-Path $DestinationFolder $Name) -Target $_.Source
$TargetPath = Join-Path $DestinationFolder $Name
if ($AvoidSymbolicLinks) {
Copy-Item -Path $_.Source -Destination $TargetPath
} else {
Create-SymbolicLink -Link $TargetPath -Target $_.Source
}
}
}

Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
default:
vmImage: windows-2022
- name: includeMacOS
type: boolean
- name: RunTests
type: boolean
default: true
Expand Down

0 comments on commit bce336a

Please sign in to comment.