-
Notifications
You must be signed in to change notification settings - Fork 147
/
RunCheckInTestsWithPAT.ps1
29 lines (26 loc) · 1.45 KB
/
RunCheckInTestsWithPAT.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Param(
[Parameter(mandatory=$true)]
[String]$1esPat,
[Parameter(mandatory=$true)]
[String]$cbPat,
[Parameter(mandatory=$true)]
[String]$ncPath,
[Parameter(mandatory=$true)]
[String]$msEngGitPat,
[Parameter(mandatory=$true)]
[String]$args
)
[Environment]::SetEnvironmentVariable("1ESSHAREDASSETS_BUILDXL_FEED_PAT", $1esPat, "Process")
[Environment]::SetEnvironmentVariable("CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT", $cbPat, "Process")
[Environment]::SetEnvironmentVariable("MSENG_GIT_PAT", $msEngGitPat, "Process")
[Environment]::SetEnvironmentVariable("NUGET_CREDENTIALPROVIDERS_PATH", $ncPath, "Process")
# NPM authentication requires the PAT to be base64 encoded first
$cbPatBytes = [System.Text.Encoding]::UTF8.GetBytes($cbPat)
$b64CloudbuildPat = [Convert]::ToBase64String($cbPatBytes)
[Environment]::SetEnvironmentVariable("CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT_B64", $b64CloudbuildPat, "Process")
[Environment]::SetEnvironmentVariable(
"VSS_NUGET_EXTERNAL_FEED_ENDPOINTS",
<#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Not a secret")]#>
"{ `"endpointCredentials`": [ {`"endpoint`":`"https://pkgs.dev.azure.com/1essharedassets/_packaging/BuildXL/nuget/v3/index.json`", `"password`":`"$1esPat`"}, {`"endpoint`":`"https://pkgs.dev.azure.com/cloudbuild/_packaging/BuildXL.Selfhost/nuget/v3/index.json`", `"password`":`"$cbPat`"} ]}",
"Process")
.\RunCheckInTests.cmd /lab $args /internal