From 4eb84f0c0b2f8486317cc2d7f95518285a9d9c42 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 1 Feb 2023 12:49:51 -0800 Subject: [PATCH] necessary tooling updates to enable a clean assembly of the test-proxy --- .../templates/scripts/assemble-dotnet-standalone-exe.ps1 | 9 ++++++--- .../templates/steps/produce-net-standalone-packs.yml | 4 ++++ tools/test-proxy/ci.yml | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 index 0fbc91d9b15..dc9623eb9e0 100644 --- a/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 +++ b/eng/pipelines/templates/scripts/assemble-dotnet-standalone-exe.ps1 @@ -26,6 +26,8 @@ param( [string] $Target, [Parameter(mandatory=$true)] [string] $ArtifactStagingDirectory, + [Parameter(mandatory=$true)] + [string] $AssemblyName, [Parameter(mandatory=$false)] [string] $Framework = "net6.0" ) @@ -60,7 +62,8 @@ if ("$($Rid)".Contains("linux")){ Push-Location "$outputPath" # The sum contents within this folder will be: `appSettings.json`, `test-proxy.pdb`, `test-proxy` (the binary), and a certificate. # This statement grabs the first extensionless file within the produced binary folder, which will always be the binary we need to set the executable bit on. - $binaryFile = (Get-ChildItem -Path . | Where-Object { !([System.IO.Path]::HasExtension($_)) } | Select-Object -First 1).ToString().Replace("`\","/") + $binaryFile = (Get-ChildItem -Path . | Where-Object { $_.Name -eq $AssemblyName } | Select-Object -First 1).ToString().Replace("`\","/") + bash -c "chmod +x $binaryFile" tar -cvzf "$($destinationPathSegment).tar.gz" . Pop-Location @@ -70,7 +73,7 @@ elseif("$($Rid)".Contains("osx")){ # a mac system. However, the `codesign` command is only available on a MacOS agent. With that being the case, we simply special case # this function here to ensure that the script does not fail outside of a MacOS agent. if ($IsMacOS) { - $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { !([System.IO.Path]::hasExtension($_)) } | Select-Object -First 1 + $binaryFile = Get-ChildItem -Path $outputPath | Where-Object { _.Name -eq $AssemblyName } | Select-Object -First 1 $binaryFileBash = $binaryFile.ToString().Replace("`\","/") $entitlements = (Resolve-Path -Path (Join-Path $PSScriptRoot ".." ".." ".." "dotnet-executable-entitlements.plist")).ToString().Replace("`\", "/") @@ -86,7 +89,7 @@ else { } # clean up the uncompressed artifact directory -Remove-Item -Recurse -Force -Path $outputPath +# Remove-Item -Recurse -Force -Path $outputPath diff --git a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml index 82704b05a99..7665c15acb2 100644 --- a/eng/pipelines/templates/steps/produce-net-standalone-packs.yml +++ b/eng/pipelines/templates/steps/produce-net-standalone-packs.yml @@ -11,10 +11,13 @@ parameters: # A `BuildMatrix` is merely a list of possible targeted platforms. .NET 6+ can build for any target from any other target. # - rid: win-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy # - rid: linux-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy # - rid: osx-x64 # framework: net6.0 + # assembly: Azure.Sdk.Tools.TestProxy steps: - ${{ each target in parameters.BuildMatrix }}: @@ -29,6 +32,7 @@ steps: -Target "${{ parameters.TargetDirectory }}" -ArtifactStagingDirectory "$(Build.ArtifactStagingDirectory)" -Framework "${{ target.framework }}" + -AssemblyName "${{ target.assembly }}" pwsh: true displayName: 'Produce Executable for ${{ target.rid }}' condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) diff --git a/tools/test-proxy/ci.yml b/tools/test-proxy/ci.yml index dd45c7298bd..199f7130872 100644 --- a/tools/test-proxy/ci.yml +++ b/tools/test-proxy/ci.yml @@ -53,11 +53,16 @@ extends: StandaloneExeMatrix: - rid: osx-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: osx-arm64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: win-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: linux-x64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy - rid: linux-arm64 framework: net6.0 + assembly: Azure.Sdk.Tools.TestProxy