Set custom test variables in build job (#4020)
This commit is contained in:
Родитель
29b7921e83
Коммит
427097824d
|
@ -43,44 +43,12 @@ stages:
|
|||
}
|
||||
echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$imageBuilderBuildArgs"
|
||||
displayName: Set Custom Build Variables
|
||||
- powershell: |
|
||||
# Forward team project name for consumption by test script
|
||||
$testRunnerOptions="-e SYSTEM_TEAMPROJECT='$env:SYSTEM_TEAMPROJECT'"
|
||||
|
||||
echo "##vso[task.setvariable variable=testRunner.options]$testRunnerOptions"
|
||||
displayName: Set Custom Test Variables
|
||||
- template: ../../../pipelines/steps/set-custom-test-variables.yml
|
||||
- template: ../../../pipelines/steps/set-base-image-override-options.yml
|
||||
parameters:
|
||||
variableName: imageBuilderBuildArgs
|
||||
customTestInitSteps:
|
||||
- powershell: |
|
||||
# Forward team project name for consumption by test script
|
||||
$testRunnerOptions="-e SYSTEM_TEAMPROJECT='$env:SYSTEM_TEAMPROJECT'"
|
||||
$testInit=""
|
||||
|
||||
if ("$(publishRepoPrefix)".Contains("/internal/")) {
|
||||
if ("$env:ENABLEINTERNAL3_1" -eq "true") {
|
||||
$sasQueryString = "$(dotnetclimsrc-read-sas-token)"
|
||||
}
|
||||
else {
|
||||
$sasQueryString = "$(dotnetbuilds-internal-container-read-token)"
|
||||
}
|
||||
|
||||
if ($Env:AGENT_OS -eq 'Linux') {
|
||||
$testRunnerOptions="$testRunnerOptions -e SAS_QUERY_STRING='$sasQueryString' -e NUGET_FEED_PASSWORD='$(dn-bot-dnceng-artifact-feeds-rw)'"
|
||||
}
|
||||
|
||||
if ($Env:AGENT_OS -eq 'Windows_NT') {
|
||||
# Be sure to use a verbatim string when referencing the environment variables. We don't want the
|
||||
# variables to be resolved in this script. We're generating the script here to be executed by the
|
||||
# test step.
|
||||
$testInit='$Env:SAS_QUERY_STRING=' + "'$sasQueryString'" + '; $Env:NUGET_FEED_PASSWORD=''$(dn-bot-dnceng-artifact-feeds-rw)'''
|
||||
}
|
||||
}
|
||||
|
||||
echo "##vso[task.setvariable variable=testRunner.options]$testRunnerOptions"
|
||||
echo "##vso[task.setvariable variable=test.init]$testInit"
|
||||
displayName: Set Custom Test Variables
|
||||
- template: ../../../pipelines/steps/set-custom-test-variables.yml
|
||||
customPublishInitSteps:
|
||||
- template: ../../../pipelines/steps/set-public-source-branch-var.yml
|
||||
- template: ../../../pipelines/steps/set-publish-mcrdocs-args-var.yml
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
steps:
|
||||
- powershell: |
|
||||
# Forward team project name for consumption by test script
|
||||
$testRunnerOptions="-e SYSTEM_TEAMPROJECT='$env:SYSTEM_TEAMPROJECT'"
|
||||
$testInit=""
|
||||
|
||||
if ("$(publishRepoPrefix)".Contains("/internal/")) {
|
||||
if ("$env:ENABLEINTERNAL3_1" -eq "true") {
|
||||
$sasQueryString = "$(dotnetclimsrc-read-sas-token)"
|
||||
}
|
||||
else {
|
||||
$sasQueryString = "$(dotnetbuilds-internal-container-read-token)"
|
||||
}
|
||||
|
||||
if ($Env:AGENT_OS -eq 'Linux') {
|
||||
$testRunnerOptions="$testRunnerOptions -e SAS_QUERY_STRING='$sasQueryString' -e NUGET_FEED_PASSWORD='$(dn-bot-dnceng-artifact-feeds-rw)'"
|
||||
}
|
||||
|
||||
if ($Env:AGENT_OS -eq 'Windows_NT') {
|
||||
# Be sure to use a verbatim string when referencing the environment variables. We don't want the
|
||||
# variables to be resolved in this script. We're generating the script here to be executed by the
|
||||
# test step.
|
||||
$testInit='$Env:SAS_QUERY_STRING=' + "'$sasQueryString'" + '; $Env:NUGET_FEED_PASSWORD=''$(dn-bot-dnceng-artifact-feeds-rw)'''
|
||||
}
|
||||
}
|
||||
|
||||
echo "##vso[task.setvariable variable=testRunner.options]$testRunnerOptions"
|
||||
echo "##vso[task.setvariable variable=test.init]$testInit"
|
||||
displayName: Set Custom Test Variables
|
Загрузка…
Ссылка в новой задаче