Skip to content

Commit 3e0e6dd

Browse files
authored
consume dotnet core 2.1, add win-x86 and linux-arm agent. (#1844)
1 parent 3e61f3e commit 3e0e6dd

31 files changed

+760
-211
lines changed

.vsts.ci.yml

+84-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
phases:
22

33
################################################################################
4-
- phase: build_windows_agent
4+
- phase: build_windows_x64_agent
55
################################################################################
6-
displayName: Windows Agent
6+
displayName: Windows Agent (x64)
77
queue:
88
name: Hosted VS2017
9-
condition: eq(false, variables.skip_windows)
9+
condition: eq(false, variables.skip_windows_x64)
1010
steps:
1111

1212
# Steps template for windows platform
1313
- template: .vsts.template.windows.yml
14-
14+
1515
# Package dotnet core windows dependency (VC++ Redistributable)
1616
- powershell: |
1717
Write-Host "Downloading 'VC++ Redistributable' package."
1818
$outDir = Join-Path -Path $env:TMP -ChildPath ([Guid]::NewGuid())
1919
New-Item -Path $outDir -ItemType directory
2020
$outFile = Join-Path -Path $outDir -ChildPath "ucrt.zip"
21-
Invoke-WebRequest -Uri https://vstsagenttools.blob.core.windows.net/tools/ucrt/ucrt.zip -OutFile $outFile
21+
Invoke-WebRequest -Uri https://vstsagenttools.blob.core.windows.net/tools/ucrt/ucrt_x64.zip -OutFile $outFile
2222
Write-Host "Unzipping 'VC++ Redistributable' package to agent layout."
2323
$unzipDir = Join-Path -Path $outDir -ChildPath "unzip"
2424
Add-Type -AssemblyName System.IO.Compression.FileSystem
@@ -36,20 +36,92 @@ phases:
3636

3737
# Upload agent package zip as build artifact
3838
- task: PublishBuildArtifacts@1
39-
displayName: Publish Artifact (Windows)
39+
displayName: Publish Artifact (Windows x64)
40+
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
41+
inputs:
42+
pathToPublish: _package
43+
artifactName: agent
44+
artifactType: container
45+
46+
################################################################################
47+
- phase: build_windows_x86_agent
48+
################################################################################
49+
displayName: Windows Agent (x86)
50+
queue:
51+
name: buildDevs
52+
demands: 'Agent.OSArchitecture -equals X86'
53+
condition: eq(false, variables.skip_windows_x86)
54+
steps:
55+
56+
# Steps template for windows platform
57+
- template: .vsts.template.windows.yml
58+
59+
# Package dotnet core windows dependency (VC++ Redistributable)
60+
- powershell: |
61+
Write-Host "Downloading 'VC++ Redistributable' package."
62+
$outDir = Join-Path -Path $env:TMP -ChildPath ([Guid]::NewGuid())
63+
New-Item -Path $outDir -ItemType directory
64+
$outFile = Join-Path -Path $outDir -ChildPath "ucrt.zip"
65+
Invoke-WebRequest -Uri https://vstsagenttools.blob.core.windows.net/tools/ucrt/ucrt_x86.zip -OutFile $outFile
66+
Write-Host "Unzipping 'VC++ Redistributable' package to agent layout."
67+
$unzipDir = Join-Path -Path $outDir -ChildPath "unzip"
68+
Add-Type -AssemblyName System.IO.Compression.FileSystem
69+
[System.IO.Compression.ZipFile]::ExtractToDirectory($outFile, $unzipDir)
70+
$agentLayoutBin = Join-Path -Path $(Build.SourcesDirectory) -ChildPath "_layout\bin"
71+
Copy-Item -Path $unzipDir -Destination $agentLayoutBin -Force
72+
displayName: Package UCRT
73+
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
74+
75+
# Create agent package zip
76+
- script: dev.cmd package Release
77+
workingDirectory: src
78+
displayName: Package Release
79+
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
80+
81+
# Upload agent package zip as build artifact
82+
- task: PublishBuildArtifacts@1
83+
displayName: Publish Artifact (Windows x86)
84+
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
85+
inputs:
86+
pathToPublish: _package
87+
artifactName: agent
88+
artifactType: container
89+
90+
################################################################################
91+
- phase: build_linux_x64_agent
92+
################################################################################
93+
displayName: Linux Agent (x64)
94+
queue:
95+
name: Hosted Ubuntu 1604
96+
condition: eq(false, variables.skip_linux_x64)
97+
steps:
98+
99+
# Steps template for windows platform
100+
- template: .vsts.template.nonwindows.yml
101+
102+
# Create agent package zip
103+
- script: ./dev.sh package Release
104+
workingDirectory: src
105+
displayName: Package Release
106+
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
107+
108+
# Upload agent package zip as build artifact
109+
- task: PublishBuildArtifacts@1
110+
displayName: Publish Artifact (Linux x64)
40111
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
41112
inputs:
42113
pathToPublish: _package
43114
artifactName: agent
44115
artifactType: container
45116

46117
################################################################################
47-
- phase: build_linux_agent
118+
- phase: build_linux_arm_agent
48119
################################################################################
49-
displayName: Linux Agent
120+
displayName: Linux Agent (ARM)
50121
queue:
51-
name: Hosted Linux Preview
52-
condition: eq(false, variables.skip_linux)
122+
name: buildDevs
123+
demands: 'Agent.OSArchitecture -equals ARM'
124+
condition: eq(false, variables.skip_linux_arm)
53125
steps:
54126

55127
# Steps template for windows platform
@@ -63,7 +135,7 @@ phases:
63135

64136
# Upload agent package zip as build artifact
65137
- task: PublishBuildArtifacts@1
66-
displayName: Publish Artifact (Linux)
138+
displayName: Publish Artifact (Linux ARM)
67139
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
68140
inputs:
69141
pathToPublish: _package
@@ -73,7 +145,7 @@ phases:
73145
################################################################################
74146
- phase: build_osx_agent
75147
################################################################################
76-
displayName: OSX Agent
148+
displayName: macOS Agent (x64)
77149
queue:
78150
name: Hosted macOS Preview
79151
condition: eq(false, variables.skip_macos)

0 commit comments

Comments
 (0)