-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[2.2] Switch queues used during Windows builds #6667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,6 @@ | |
# A map of custom variables | ||
# matrix: { string: { string: string } } | ||
# A map of matrix configurations and variables. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#matrix | ||
# demands: string | [ string ] | ||
# A list of agent demands. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#demands | ||
# dependsOn: string | [ string ] | ||
# For fan-out/fan-in. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#phase | ||
# codeSign: boolean | ||
|
@@ -45,7 +43,6 @@ parameters: | |
poolName: '' | ||
buildArgs: '' | ||
configuration: 'Release' | ||
demands: [] | ||
beforeBuild: [] | ||
afterBuild: [] | ||
codeSign: false | ||
|
@@ -71,6 +68,7 @@ jobs: | |
maxParallel: 8 | ||
matrix: ${{ parameters.matrix }} | ||
# Map friendly OS names to the right queue | ||
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md | ||
pool: | ||
${{ if ne(parameters.poolName, '') }}: | ||
name: ${{ parameters.poolName }} | ||
|
@@ -81,24 +79,25 @@ jobs: | |
name: Hosted Ubuntu 1604 | ||
vmImage: ubuntu-16.04 | ||
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}: | ||
${{ if ne(parameters.codeSign, 'true') }}: | ||
name: Hosted VS2017 | ||
vmImage: vs2017-win2016 | ||
${{ if eq(parameters.codeSign, 'true') }}: | ||
name: DotNetCore-Windows | ||
${{ if eq(variables['System.TeamProject'], 'internal') }}: | ||
name: dotnet-internal-temp | ||
${{ if ne(variables['System.TeamProject'], 'internal') }}: | ||
name: dotnet-external-temp | ||
variables: | ||
AgentOsName: ${{ parameters.agentOs }} | ||
ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping | ||
DOTNET_HOME: $(Agent.WorkFolder)/.dotnet | ||
DOTNET_HOME: $(Agent.BuildDirectory)/.dotnet | ||
BuildScript: ${{ parameters.buildScript }} | ||
BuildScriptArgs: ${{ parameters.buildArgs }} | ||
BuildConfiguration: ${{ parameters.configuration }} | ||
BuildDirectory: ${{ parameters.buildDirectory }} | ||
VSTS_OVERWRITE_TEMP: false # Workaround for https://github.com/dotnet/core-eng/issues/2812 | ||
${{ if eq(parameters.codeSign, 'true') }}: | ||
${{ if eq(parameters.agentOs, 'Windows') }}: | ||
JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk | ||
${{ if or(ne(parameters.codeSign, 'true'), ne(variables['System.TeamProject'], 'internal')) }}: | ||
_SignType: | ||
${{ if and(eq(parameters.codeSign, 'true'), eq(variables['System.TeamProject'], 'internal')) }}: | ||
TeamName: AspNetCore | ||
_SignType: real | ||
${{ if ne(parameters.codeSign, 'true') }}: | ||
_SignType: | ||
${{ insert }}: ${{ parameters.variables }} | ||
steps: | ||
- checkout: self | ||
|
@@ -107,13 +106,17 @@ jobs: | |
displayName: Install Node 10.x | ||
inputs: | ||
versionSpec: 10.x | ||
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}: | ||
- ${{ if eq(parameters.agentOs, 'Windows') }}: | ||
- powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' | ||
displayName: Install JDK 11 | ||
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}: | ||
- task: MicroBuildSigningPlugin@1 | ||
displayName: Install MicroBuild Signing plugin | ||
condition: and(succeeded(), in(variables['_SignType'], 'test', 'real')) | ||
inputs: | ||
signType: $(_SignType) | ||
zipSources: false | ||
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doubt this is harmful but why is it necessary now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Different agents have different versions of the MicroBuildSigning Plugin. The new agents we are switching to require us to specify this parameter. |
||
- ${{ parameters.beforeBuild }} | ||
- ${{ if eq(parameters.agentOs, 'Windows') }}: | ||
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs) | ||
|
@@ -124,6 +127,7 @@ jobs: | |
- task: PublishTestResults@2 | ||
displayName: Publish test results | ||
condition: always() | ||
continueOnError: true | ||
inputs: | ||
testRunTitle: $(AgentOsName)-$(BuildConfiguration) | ||
testRunner: vstest | ||
|
@@ -133,6 +137,7 @@ jobs: | |
- task: PublishBuildArtifacts@1 | ||
displayName: Upload artifacts | ||
condition: eq(variables['system.pullrequest.isfork'], false) | ||
continueOnError: true | ||
inputs: | ||
${{ if eq(parameters.buildDirectory, '') }}: | ||
pathtoPublish: ${{ parameters.artifacts.path }} | ||
|
@@ -145,7 +150,7 @@ jobs: | |
artifactType: Container | ||
parallel: true | ||
- ${{ parameters.afterBuild }} | ||
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}: | ||
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows')) }}: | ||
- task: MicroBuildCleanup@1 | ||
displayName: Cleanup MicroBuild tasks | ||
condition: always() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
param( | ||
[Parameter(Mandatory = $true)] | ||
$JdkVersion | ||
) | ||
|
||
$ErrorActionPreference = 'Stop' | ||
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 | ||
|
||
Set-StrictMode -Version 1 | ||
|
||
if (-not $env:JAVA_HOME) { | ||
throw 'You must set the JAVA_HOME environment variable to the destination of the JDK.' | ||
} | ||
|
||
$repoRoot = Resolve-Path "$PSScriptRoot/../.." | ||
$tempDir = "$repoRoot/obj" | ||
mkdir $tempDir -ea Ignore | out-null | ||
Write-Host "Starting download of JDK ${JdkVersion}" | ||
Invoke-WebRequest -UseBasicParsing -Uri "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/java/jdk-${JdkVersion}_windows-x64_bin.zip" -Out "$tempDir/jdk.zip" | ||
Write-Host "Done downloading JDK ${JdkVersion}" | ||
Expand-Archive "$tempDir/jdk.zip" -d "$tempDir/jdk/" | ||
Write-Host "Expanded JDK to $tempDir" | ||
mkdir (split-path -parent $env:JAVA_HOME) -ea ignore | out-null | ||
Write-Host "Installing JDK to $env:JAVA_HOME" | ||
Move-Item "$tempDir/jdk/jdk-${jdkVersion}" $env:JAVA_HOME | ||
Write-Host "Done installing JDK to $env:JAVA_HOME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that we've got a
$env:Temp
folder now 😺