From d286ae6e55f298420eab0c398302ba14040995e6 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Fri, 15 Jul 2022 11:48:28 -0700 Subject: [PATCH 1/2] someone wants to reference the test-proxy startup scripts externally. to make this easy on them we're parameterizing the root of the eng/common for easy use in that scenario --- eng/common/testproxy/test-proxy-docker.yml | 5 +++-- eng/common/testproxy/test-proxy-tool.yml | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml index df2548ab776..52a7c807a3d 100644 --- a/eng/common/testproxy/test-proxy-docker.yml +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -1,10 +1,11 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' targetVersion: '' + templateRoot: '$(Build.SourcesDirectory)' steps: - pwsh: | - $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 + ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | @@ -12,7 +13,7 @@ steps: displayName: 'Dump active docker information' - pwsh: | - $(Build.SourcesDirectory)/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}" + ${{ parameters.templateRoot }}/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}" displayName: 'Run the docker container' - pwsh: | diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 7b5fedaaeb3..40c5bd5b6ad 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -2,14 +2,15 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' runProxy: true targetVersion: '' + templateRoot: '$(Build.SourcesDirectory)' steps: - pwsh: | - $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 + ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | - $version = $(Get-Content "$(Build.SourcesDirectory)/eng/common/testproxy/target_version.txt" -Raw).Trim() + $version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim() $overrideVersion = "${{ parameters.targetVersion }}" if($overrideVersion) { @@ -29,7 +30,7 @@ steps: - ${{ if eq(parameters.runProxy, 'true') }}: - pwsh: | - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" + Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx" Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' @@ -37,13 +38,13 @@ steps: - pwsh: | Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` -ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` - -NoNewWindow -PassThru -RedirectStandardOutput $(Build.SourcesDirectory)/test-proxy.log + -NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log displayName: 'Run the testproxy - windows' condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) # nohup does NOT continue beyond the current session if you use it within powershell - bash: | - nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > $(Build.SourcesDirectory)/test-proxy.log & + nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.templateRoot }}/test-proxy.log & displayName: "Run the testproxy - linux/mac" condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) workingDirectory: "${{ parameters.rootFolder }}" From b3a356fd5b125862f68f746da6fdcdfe09c15ddf Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Fri, 15 Jul 2022 15:20:26 -0700 Subject: [PATCH 2/2] two leading $ signs on the definition of the certificate path was causing some issues! --- eng/common/testproxy/test-proxy-tool.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 40c5bd5b6ad..679ad2108d7 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -30,7 +30,7 @@ steps: - ${{ if eq(parameters.runProxy, 'true') }}: - pwsh: | - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx" + Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx" Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'