From fb8bb7c301b95407a7fde655706b07306fbe19b7 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:51:19 -0700 Subject: [PATCH 1/7] consume new package location --- .../pipelines/templates/steps/install-pipeline-generation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml index d368d52595b3..b19093b0aaa8 100644 --- a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml +++ b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml @@ -10,7 +10,7 @@ steps: dotnet tool install Azure.Sdk.Tools.PipelineGenerator --version 1.0.2-dev.20210621.4 - --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk/nuget/v3/index.json + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --tool-path ${{parameters.ToolPath}} workingDirectory: $(Pipeline.Workspace)/pipeline-generator displayName: 'Install pipeline generator tool' From dfdb188bacba928663ba0601b0d571517969712b Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Fri, 13 Aug 2021 15:52:01 -0700 Subject: [PATCH 2/7] updates to eng common, moving proxy tools to location --- eng/common/scripts/common.ps1 | 1 + eng/common/testproxy/docker-start-proxy.ps1 | 83 +++++++++++++++++++++ eng/common/testproxy/dotnet-devcert.crt | 20 +++++ eng/common/testproxy/invoke-proxy.sh | 1 + eng/common/testproxy/test-proxy-docker.yml | 20 +++++ eng/common/testproxy/test-proxy-tool.yml | 52 +++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 eng/common/testproxy/docker-start-proxy.ps1 create mode 100644 eng/common/testproxy/dotnet-devcert.crt create mode 100644 eng/common/testproxy/invoke-proxy.sh create mode 100644 eng/common/testproxy/test-proxy-docker.yml create mode 100644 eng/common/testproxy/test-proxy-tool.yml diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index 4e0b0847cdbf..4f31c92c3d20 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -44,3 +44,4 @@ $GetDocsMsMetadataForPackageFn = "Get-${Language}-DocsMsMetadataForPackage" $GetDocsMsDevLanguageSpecificPackageInfoFn = "Get-${Language}-DocsMsDevLanguageSpecificPackageInfo" $GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex" $FindArtifactForApiReviewFn = "Find-${Language}-Artifacts-For-Apireview" +$TestProxyTrustCertFn = "Import-Dev-Cert-${Language}" diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1 new file mode 100644 index 000000000000..4e5da37278a2 --- /dev/null +++ b/eng/common/testproxy/docker-start-proxy.ps1 @@ -0,0 +1,83 @@ + #!/usr/bin/env pwsh -c + +<# +.DESCRIPTION +Start the docker proxy container. If it is already running, quietly exit. Any other error should fail. +.PARAMETER Mode +"start" or "stop" to start up or stop the test-proxy instance. +.PARAMETER TargetFolder +The folder in which context the test proxy will be started. Defaults to current working directory. +#> +[CmdletBinding(SupportsShouldProcess = $true)] +param( + [ValidateSet("start", "stop")] + [String] + $Mode, + [String] + $TargetFolder = "." +) + +try { + docker --version | Out-Null +} +catch { + Write-Error "A invocation of docker --version failed. This indicates that docker is not properly installed or running." + Write-Error "Please check your docker invocation and try running the script again." +} + +$SELECTED_IMAGE_TAG = "1037115" +$CONTAINER_NAME = "ambitious_azsdk_test_proxy" +$LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}" +$WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}" +$root = (Resolve-Path $TargetFolder).Path.Replace("`\", "/") + +function Get-Proxy-Container(){ + return (docker container ls -a --format "{{ json . }}" --filter "name=$CONTAINER_NAME" ` + | ConvertFrom-Json ` + | Select-Object -First 1) +} + + +$SelectedImage = $LINUX_IMAGE_SOURCE +$Initial = "" + +# most of the time, running this script on a windows machine will work just fine, as docker defaults to linux containers +# however, in CI, windows images default to _windows_ containers. We cannot swap them. We can tell if we're in a CI build by +# checking for the environment variable TF_BUILD. +if ($IsWindows -and $env:TF_BUILD){ + $SelectedImage = $WINDOWS_IMAGE_SOURCE + $Initial = "C:" +} + +if ($Mode -eq "start"){ + $proxyContainer = Get-Proxy-Container + + # if we already have one, we just need to check the state + if($proxyContainer){ + if ($proxyContainer.State -eq "running") + { + Write-Host "Discovered an already running instance of the test-proxy!. Exiting" + exit(0) + } + } + # else we need to create it + else { + Write-Host "Attempting creation of Docker host $CONTAINER_NAME" + Write-Host "docker container create -v `"${root}:${Initial}/etc/testproxy`" -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage" + docker container create -v "${root}:${Initial}/etc/testproxy" -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage + } + + Write-Host "Attempting start of Docker host $CONTAINER_NAME" + docker container start $CONTAINER_NAME +} + +if ($Mode -eq "stop"){ + $proxyContainer = Get-Proxy-Container + + if($proxyContainer){ + if($proxyContainer.State -eq "running"){ + Write-Host "Found a running instance of $CONTAINER_NAME, shutting it down." + docker container stop $CONTAINER_NAME + } + } +} \ No newline at end of file diff --git a/eng/common/testproxy/dotnet-devcert.crt b/eng/common/testproxy/dotnet-devcert.crt new file mode 100644 index 000000000000..e8575ea44564 --- /dev/null +++ b/eng/common/testproxy/dotnet-devcert.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSDCCAjCgAwIBAgIUPMKpJ/j10eQrcQBNnkImIaOYHakwDQYJKoZIhvcNAQEL +BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDgwNTAwMzU1NloXDTIyMDgw +NTAwMzU1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAxe/ZseXgOTVoF7uTjX5Leknk95jIoyGc+VlxA8BhzGOr +r4u6VNQZRCMq+svHY36tW4+u/xHNe2kvbwy2mnS8cFFLfst+94qBZVJDBxSGZ9I/ +wekErNsjFsik4UrMvcC+ZlGPh7hb3f7tSx29tn1DIkAUXVnbZ6TT5s+mYRQpZ6fW +6kR3RNfc0A1IUM7Zs9yfNEr0O2H41P2HcLKoOPtvd7GvTQm9Ofh3srKvII+sZn/J +WH7r76oRQMX904mOMdryQwZLObsqX4dXIEbafKVSecB3PBVIhv8gVtJhcZbQP1pI +mMiWd6PHv46ZhGf7+cKnYUSa8Ia2t/wetK1wd00dFwIDAQABo4GRMIGOMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGmMBYGA1UdJQEB/wQMMAoGCCsGAQUF +BwMBMBcGA1UdEQEB/wQNMAuCCWxvY2FsaG9zdDA6BgorBgEEAYI3VAEBBCwMKkFT +UC5ORVQgQ29yZSBIVFRQUyBkZXZlbG9wbWVudCBjZXJ0aWZpY2F0ZTANBgkqhkiG +9w0BAQsFAAOCAQEAIj2VlBVcXGSly6KCBg6lgwFi+henWfSox77iuGAaAxDjN3jd +9lZahW4MPNLHKSrPRb4YNSLZ2jh7zdcttQrqd4qH65o1q56q5JrCmli99iIzY9Y8 +RdYyxK4Zzr31wjpsyFiWQfqJTuSFUUg9uDDj0negwEZLIGlt7nr12wflt2+QOJtD +byMeSZLbB5dPzn341DK0qfJEJMMgL0XsPEVZ3TQ6Alc9zq5wI608C/mXnz3xJE05 +UTYD8pRJJ/DyG0empvOVE8Sg93msHPquAbgqO9aqCpykgg/a8CFvI4wRdfvGEFlv +8XJKL8Y/PFsmFeO3axq3zUYKFVdc9Un4dFIaag== +-----END CERTIFICATE----- diff --git a/eng/common/testproxy/invoke-proxy.sh b/eng/common/testproxy/invoke-proxy.sh new file mode 100644 index 000000000000..be71a0e69212 --- /dev/null +++ b/eng/common/testproxy/invoke-proxy.sh @@ -0,0 +1 @@ +${TEST_PROXY_LOC}/test-proxy \ No newline at end of file diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml new file mode 100644 index 000000000000..e7105e43a680 --- /dev/null +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -0,0 +1,20 @@ +parameters: + rootFolder: '$(Build.SourcesDirectory)' + +steps: + - pwsh: | + . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 + + if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) + { + &$FindArtifactForApiReviewFn + } + displayName: 'Language Specific Certificate Trust' + + - pwsh: | + $(Build.SourcesDirectory)/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" + displayName: 'Run the docker container' + + - pwsh: | + docker container ls -a + displayName: Check running container \ No newline at end of file diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml new file mode 100644 index 000000000000..c31641448bfd --- /dev/null +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -0,0 +1,52 @@ +parameters: + rootFolder: '$(Build.SourcesDirectory)' + +steps: + - pwsh: | + . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 + + if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) + { + &$FindArtifactForApiReviewFn + } + displayName: 'Language Specific Certificate Trust' + + - pwsh: | + Write-Host "##vso[task.setvariable variable=OriginalPath]$env:PATH" + displayName: 'Store Path Value' + + - 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__Password]password" + displayName: 'Configure Kestrel Environment Variables' + + - task: UseDotNet@2 + displayName: "Use .NET Core SDK" + inputs: + packageType: sdk + version: 5.0.205 + + - pwsh: | + dotnet tool install azure.sdk.tools.testproxy ` + --tool-path $(Build.BinariesDirectory)/test-proxy ` + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json ` + --version 1.0.0-dev.20210811.2 + displayName: "Install test-proxy" + + - pwsh: | + Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` + -ArgumentList "--storage-location '${{ parameters.rootFolder }}'" ` + -NoNewWindow -PassThru + 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: | + sudo nohup $(Build.BinariesDirectory)/test-proxy/test-proxy & + displayName: "Run the testproxy - linux/mac" + condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) + workingDirectory: "${{ parameters.rootFolder }}" + + - pwsh: | + Write-Host "##vso[task.setvariable variable=PATH]$(OriginalPath)" + displayName: 'Restore .NET version by resetting path' \ No newline at end of file From ae63837e602c9567da61803c4db86ff08a642208 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Fri, 13 Aug 2021 15:53:57 -0700 Subject: [PATCH 3/7] store components --- eng/common/testproxy/dotnet-devcert.pfx | Bin 0 -> 2445 bytes eng/common/testproxy/invoke-proxy.sh | 1 - 2 files changed, 1 deletion(-) create mode 100644 eng/common/testproxy/dotnet-devcert.pfx delete mode 100644 eng/common/testproxy/invoke-proxy.sh diff --git a/eng/common/testproxy/dotnet-devcert.pfx b/eng/common/testproxy/dotnet-devcert.pfx new file mode 100644 index 0000000000000000000000000000000000000000..28058ae4ce30e7a413e8f872d930fa2cf5c2107c GIT binary patch literal 2445 zcmY+Ec{me}AIEKGOw3W1T%&R;L(Z@fa?O=93FS=q=BQl7a-{|M|6Xqd27(0wI1w0#Ef}JdY@Ym$AHWSL zz(7zS3`GAI)K?F!Tb zfjk`X7|v1{OYWP-ZccVCBTB-xZYA4g%!tC;_FsW8vbMzZGh3`8ogVrPMR>ljPU4#- z`G@P4g@lf03(hTENs)vkx^jBoGHwj2avv-Dpe_DO>@3jk<%U$iX9rZd`=jP! zsg>})<%?TyfZg|Y*>jhF5Sk^W#Xi;Zf992<-1wem2j0S$iBLn3j~5NK^GDtfIXo`5 zEs4Sf`)CEeP0j%@`i~ke|2fh@=L=@SIJ}`Y+kWWchubBzbXCRXNLitiiMY3dmu!a( zFZPEvT^=8TlPT8*{GH8Y<-2>g>eDZprB2Z+>uP-Z?YAXY9h_{s@4_XehsU4Id_iyC zJ+N--k7cI{U3Bi+p2UKd+buQ)=Z*I*(W5Hw)&cuE;drYzBT8WE$tY9^^4o53%-qi5 z=n{`d!C!c+~BNXhVHGYMn+(JJ0#LCDfvOFPO#fMYz)uYiLDW|Co z(JGTK!;W~b1WLVc_OQ;;y-e`1>Itds$%e}1YQK|Ze#ae*l3sb6q>JipNOI#XV=WLu zsiaZOG)Y@E9Hc?8IGLp#_fdMEJxgwAltLxG(ZXfxQMhi>=<_k}P;!U4_5&K0su_n9 zQ&wnVaA_R&m2zs__fZs>G)%_NW)SfLFgowbEDRqBT^z zJMo)_(u@dc8+TU{Xdrq5=H(TjX}T`cCNE>>pH3;Ad}l6&(NCGu#)3`Gm)tWnFX*fWw>iusH-DeXc-0_K%B?cPcYb`dW?L5*s2f4hp zKeP|&@yDS&;8*PpQw~cQEhAf!7vf#A2DL4a-dY3E@O)XZKK~Y*%(FLu`*?(Zen_F2 zPxvUY0RHLI{s$pqq*$-r#fUBwfZo(KCs%hX?u@6-^jp@|GJ(4$>d|yLeaX7K7qf1N25=t-MWP)nc}xHt_coMNUZF&!y2dObegcrn^uF-D>4qs;DA=zqU?bmyx|I zx{YWUS(>xDdPsmyh{Z*-lg^&5RYzXkyVj#%Jjao_N!q@F2y*i=D;iN=%^8j1li)|W zO$Tp!3PT4fpfxfDq zUhF8y%X|XI1;l*cygss_+G?*f_ik^z=Ke5}=A~KOvHxYg)!i}dxwR25Xf+f!SPifN zK_Y9AKWpP+oI@T^$XT5`{_B4e3fD|c@Q}89T*QQwyld*zXZCAD4>GC}9;NG;RG0(5 znCLlG-=@yqe0I($$p5%?wp-oxY5FwGxwa%0!TBYiZX~;QPV~q@A%SXMowq=`bW3rT zPIq&knIrEPBS8(i=47qf){UF!GGy&r0Z;BbJc~h^^*-$0zZUMj%x?59QtrM0%^JKZ$4FPS{j?Ut<*pX!#dB%!EbOGU5*$5VFUa)Y@$M;Z z4sl8Ns(swP-zX*T#^Q9`@)Sed>bf4v-3@?4?C!~cisATi`B3dvT1mth0W%(+%O^(X)3 zB7ad%T0XtsUdE>o28`a;_iQtx4RfXR|6{`h;drtDABlWO*H zgT|>(isc2UO4D+-y-(X5*;PMlIb6=BB$EqoGaR;5T|(3cEW!exbkWR0 zKSxCTZ>!9^nIMV@rXZp3&~tT3_6(~U@dzr@{&LObWzJXp+%8Ugw8q*?g_nMorpp7&E#Ztx{^h3z}&B?D+fl@MlU+)b>qDi^1L1WD%$SyN(bMH5llaAfgwMN+(1yb)GL# zB644QI=;pr)DSWV2$)M5$_W(X;s71nM&EriZMXu9q4}jIu`Zb2ZMe}2;=yh6dp0e8 JEc(5Y{{n}~oSOgu literal 0 HcmV?d00001 diff --git a/eng/common/testproxy/invoke-proxy.sh b/eng/common/testproxy/invoke-proxy.sh deleted file mode 100644 index be71a0e69212..000000000000 --- a/eng/common/testproxy/invoke-proxy.sh +++ /dev/null @@ -1 +0,0 @@ -${TEST_PROXY_LOC}/test-proxy \ No newline at end of file From 77708b146756d6552b5dbdb3faf91ffd185fb117 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:00:24 -0700 Subject: [PATCH 4/7] update call of the certificate check --- eng/common/testproxy/test-proxy-docker.yml | 4 ++-- eng/common/testproxy/test-proxy-tool.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml index e7105e43a680..08bd93cf10cf 100644 --- a/eng/common/testproxy/test-proxy-docker.yml +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -5,9 +5,9 @@ steps: - pwsh: | . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 - if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) + if ($TestProxyTrustCertFn -and (Test-Path "Function:$TestProxyTrustCertFn")) { - &$FindArtifactForApiReviewFn + &$TestProxyTrustCertFn } displayName: 'Language Specific Certificate Trust' diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index c31641448bfd..5a803021a78a 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -5,9 +5,9 @@ steps: - pwsh: | . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 - if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) + if ($TestProxyTrustCertFn -and (Test-Path "Function:$TestProxyTrustCertFn")) { - &$FindArtifactForApiReviewFn + &$TestProxyTrustCertFn } displayName: 'Language Specific Certificate Trust' From 6a46582cba939ce70fa0096ffe9e81e3ebf7fcfe Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:16:01 -0700 Subject: [PATCH 5/7] move all files under eng/common --- eng/common/testproxy/apply-dev-cert.sh | 31 ++++++++++++++++++++++++++ eng/common/testproxy/localhost.conf | 23 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 eng/common/testproxy/apply-dev-cert.sh create mode 100644 eng/common/testproxy/localhost.conf diff --git a/eng/common/testproxy/apply-dev-cert.sh b/eng/common/testproxy/apply-dev-cert.sh new file mode 100644 index 000000000000..5b4523e8c3c6 --- /dev/null +++ b/eng/common/testproxy/apply-dev-cert.sh @@ -0,0 +1,31 @@ +#!/bin/bash +TMP_PATH=$CERT_FOLDER +PFXFILE=$CERT_FOLDER/dotnet-devcert.pfx +CRTFILE=$CERT_FOLDER/dotnet-devcert.crt + +NSSDB_PATHS=( + "$HOME/.pki/nssdb" + "$HOME/snap/chromium/current/.pki/nssdb" + "$HOME/snap/postman/current/.pki/nssdb" +) + +function configure_nssdb() { + echo "Configuring nssdb for $1" + certutil -d sql:$1 -D -n dotnet-devcert + certutil -d sql:$1 -A -t "CP,," -n dotnet-devcert -i $CRTFILE +} + +for NSSDB in ${NSSDB_PATHS[@]}; do + if [ -d "$NSSDB" ]; then + configure_nssdb $NSSDB + fi +done + +if [ $(id -u) -ne 0 ]; then + SUDO='sudo' +fi + +$SUDO cp $CRTFILE "/usr/local/share/ca-certificates" +$SUDO update-ca-certificates + +dotnet dev-certs https --clean --import $PFXFILE -p "password" diff --git a/eng/common/testproxy/localhost.conf b/eng/common/testproxy/localhost.conf new file mode 100644 index 000000000000..2e03415293cc --- /dev/null +++ b/eng/common/testproxy/localhost.conf @@ -0,0 +1,23 @@ +[req] +prompt = no +default_bits = 2048 +distinguished_name = subject +req_extensions = req_ext +x509_extensions = x509_ext + +[ subject ] +commonName = localhost + +[req_ext] +basicConstraints = critical, CA:true +subjectAltName = @alt_names + +[x509_ext] +basicConstraints = critical, CA:true +keyUsage = critical, keyCertSign, cRLSign, digitalSignature,keyEncipherment +extendedKeyUsage = critical, serverAuth +subjectAltName = critical, @alt_names +1.3.6.1.4.1.311.84.1.1 = ASN1:UTF8String:ASP.NET Core HTTPS development certificate # Needed to get it imported by dotnet dev-certs + +[alt_names] +DNS.1 = localhost From be6758e3fc113b871220ad4cc28c164b74e4f0b0 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:59:53 -0700 Subject: [PATCH 6/7] add prepare stage. update readmes about moving location of the certificate. only necessary to add pre-step to container publish --- eng/common/scripts/trust-proxy-certificate.ps1 | 6 ++++++ eng/common/testproxy/test-proxy-docker.yml | 7 +------ eng/common/testproxy/test-proxy-tool.yml | 7 +------ 3 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 eng/common/scripts/trust-proxy-certificate.ps1 diff --git a/eng/common/scripts/trust-proxy-certificate.ps1 b/eng/common/scripts/trust-proxy-certificate.ps1 new file mode 100644 index 000000000000..144d304cfd18 --- /dev/null +++ b/eng/common/scripts/trust-proxy-certificate.ps1 @@ -0,0 +1,6 @@ +. $PSScriptRoot/common.ps1 + +if ($TestProxyTrustCertFn -and (Test-Path "Function:$TestProxyTrustCertFn")) +{ + &$TestProxyTrustCertFn +} \ No newline at end of file diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml index 08bd93cf10cf..97617b6fd08a 100644 --- a/eng/common/testproxy/test-proxy-docker.yml +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -3,12 +3,7 @@ parameters: steps: - pwsh: | - . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 - - if ($TestProxyTrustCertFn -and (Test-Path "Function:$TestProxyTrustCertFn")) - { - &$TestProxyTrustCertFn - } + $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 5a803021a78a..9f24b0f0d527 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -3,12 +3,7 @@ parameters: steps: - pwsh: | - . $(Build.SourcesDirectory)/eng/common/scripts/common.ps1 - - if ($TestProxyTrustCertFn -and (Test-Path "Function:$TestProxyTrustCertFn")) - { - &$TestProxyTrustCertFn - } + $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | From 8c17bb2ee4d25951a00e5e649c9421adb6a4a16d Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:15:23 -0700 Subject: [PATCH 7/7] revert changes to install-pipeline-generation --- .../pipelines/templates/steps/install-pipeline-generation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml index b19093b0aaa8..d368d52595b3 100644 --- a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml +++ b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml @@ -10,7 +10,7 @@ steps: dotnet tool install Azure.Sdk.Tools.PipelineGenerator --version 1.0.2-dev.20210621.4 - --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk/nuget/v3/index.json --tool-path ${{parameters.ToolPath}} workingDirectory: $(Pipeline.Workspace)/pipeline-generator displayName: 'Install pipeline generator tool'