Skip to content

Commit 72bf366

Browse files
Update the 1ES image and remove unnecessary dependencies (#79)
1 parent 1b2bfc0 commit 72bf366

File tree

4 files changed

+19
-63
lines changed

4 files changed

+19
-63
lines changed

build.psm1

Lines changed: 9 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ function Start-BuildNativeUnixBinaries {
464464
}
465465
elseif ($IsMacOS) {
466466
Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./macos.toolchain.cmake" . }
467-
Start-NativeExecution { make -j }
467+
Start-NativeExecution { make -j }
468468
Start-NativeExecution { ctest --verbose }
469469
}
470470
else {
@@ -2153,63 +2153,19 @@ function Start-PSBootstrap {
21532153
$cmakePresent = precheck 'cmake' $null
21542154
$sdkPresent = Test-Win10SDK
21552155

2156-
# Install chocolatey
2157-
$chocolateyPath = "$env:AllUsersProfile\chocolatey\bin"
2158-
2159-
if(precheck 'choco' $null) {
2160-
Write-Log "Chocolatey is already installed. Skipping installation."
2161-
}
2162-
elseif(($cmakePresent -eq $false) -or ($sdkPresent -eq $false)) {
2163-
Write-Log "Chocolatey not present. Installing chocolatey."
2164-
if ($Force -or "Install chocolatey via https://chocolatey.org/install.ps1") {
2165-
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
2166-
if (-not ($machinePath.ToLower().Contains($chocolateyPath.ToLower()))) {
2167-
Write-Log "Adding $chocolateyPath to Path environment variable"
2168-
$env:Path += ";$chocolateyPath"
2169-
$newMachineEnvironmentPath += ";$chocolateyPath"
2170-
} else {
2171-
Write-Log "$chocolateyPath already present in Path environment variable"
2172-
}
2173-
} else {
2174-
Write-Error "Chocolatey is required to install missing dependencies. Please install it from https://chocolatey.org/ manually. Alternatively, install cmake and Windows 10 SDK."
2175-
return
2176-
}
2177-
} else {
2178-
Write-Log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present."
2179-
}
2180-
21812156
# Install cmake
2182-
$cmakePath = "${env:ProgramFiles}\CMake\bin"
2183-
if($cmakePresent -and !($force.IsPresent)) {
2184-
Write-Log "Cmake is already installed. Skipping installation."
2157+
#$cmakePath = "${env:ProgramFiles}\CMake\bin"
2158+
if($cmakePresent) {
2159+
Write-Log "Cmake is already installed."
21852160
} else {
2186-
Write-Log "Cmake not present or -Force used. Installing cmake."
2187-
Start-NativeExecution { choco install cmake -y --version 3.10.0 }
2188-
if (-not ($machinePath.ToLower().Contains($cmakePath.ToLower()))) {
2189-
Write-Log "Adding $cmakePath to Path environment variable"
2190-
$env:Path += ";$cmakePath"
2191-
$newMachineEnvironmentPath = "$cmakePath;$newMachineEnvironmentPath"
2192-
} else {
2193-
Write-Log "$cmakePath already present in Path environment variable"
2194-
}
2161+
throw "Cmake not present."
21952162
}
21962163

2197-
# Install Windows 10 SDK
2198-
$packageName = "windows-sdk-10.0"
2199-
2200-
if (-not $sdkPresent) {
2201-
Write-Log "Windows 10 SDK not present. Installing $packageName."
2202-
Start-NativeExecution { choco install windows-sdk-10.0 -y }
2203-
} else {
2204-
Write-Log "Windows 10 SDK present. Skipping installation."
2164+
if ($sdkPresent) {
2165+
Write-Log "Windows 10 SDK is already installed."
22052166
}
2206-
2207-
# Update path machine environment variable
2208-
if ($newMachineEnvironmentPath -ne $machinePath) {
2209-
Write-Log "Updating Path machine environment variable"
2210-
if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable to $newMachineEnvironmentPath")) {
2211-
[Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE')
2212-
}
2167+
else {
2168+
throw "Windows 10 SDK not present."
22132169
}
22142170
}
22152171
}

tools/releaseBuild/yaml/releaseBuild.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ stages:
2323
jobs:
2424
- job: BuildWin
2525
pool:
26-
vmImage: vs2017-win2016
26+
name: PowerShell1ES
27+
demands:
28+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
2729
displayName: Windows
2830
strategy:
2931
matrix:
@@ -42,7 +44,7 @@ stages:
4244
pool:
4345
name: PowerShell1ES
4446
demands:
45-
- ImageOverride -equals MMS2019
47+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
4648

4749
displayName: Sign Windows
4850
variables:
@@ -64,7 +66,9 @@ stages:
6466
- job: BuildLinux
6567
displayName: Linux
6668
pool:
67-
vmImage: ubuntu-latest
69+
name: PowerShell1ES
70+
demands:
71+
- ImageOverride -equals PSMMSUbuntu20.04-Secure
6872
strategy:
6973
matrix:
7074
UbuntuArm:
@@ -94,7 +98,7 @@ stages:
9498
pool:
9599
name: PowerShell1ES
96100
demands:
97-
- ImageOverride -equals MMS2019
101+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
98102
variables:
99103
- group: ESRP
100104

@@ -109,7 +113,7 @@ stages:
109113
pool:
110114
name: PowerShell1ES
111115
demands:
112-
- ImageOverride -equals MMS2019
116+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
113117
steps:
114118
- checkout: self
115119
clean: true

tools/releaseBuild/yaml/upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
sourcePath: ''
44

55
steps:
6-
- task: AzureFileCopy@2
6+
- task: AzureFileCopy@4
77
displayName: 'Upload ${{ parameters.fileName }} to azure blob'
88
inputs:
99
SourcePath: '${{ parameters.sourcePath }}'

tools/releaseBuild/yaml/windows-build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
steps:
2-
- powershell: |
3-
choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System'
4-
displayName: Install cmake
5-
condition: succeeded()
62
- powershell: |
73
$vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin'
84
Write-Host "##vso[task.prependpath]$vsPath"

0 commit comments

Comments
 (0)