mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Change mongodb installation from choco to .msi download (#8032)
This commit is contained in:
@@ -5,8 +5,25 @@
|
||||
|
||||
# Install mongodb package
|
||||
$toolsetVersion = (Get-ToolsetContent).mongodb.version
|
||||
$latestChocoPackage = Get-LatestChocoPackageVersion -TargetVersion $toolsetVersion -PackageName "mongodb"
|
||||
Choco-Install -PackageName mongodb -ArgumentList "--version=$latestChocoPackage"
|
||||
|
||||
$getMongoReleases = Invoke-WebRequest -Uri "https://www.mongodb.com/docs/upcoming/release-notes/$toolsetVersion" -UseBasicParsing
|
||||
$TargetReleases = $getMongoReleases.Links.href | Where-Object {$_ -like "*std-label-$toolsetVersion*"}
|
||||
|
||||
$MinorVersions = @()
|
||||
foreach ($release in $TargetReleases) {
|
||||
$pattern = '\d+\.\d+\.\d+'
|
||||
$version = $release | Select-String -Pattern $pattern -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
|
||||
$MinorVersions += $version
|
||||
}
|
||||
|
||||
$LatestVersion = $MinorVersions[0]
|
||||
|
||||
$installDir = "c:\PROGRA~1\MongoDB"
|
||||
$binaryName = "mongodb-windows-x86_64-$LatestVersion-signed.msi"
|
||||
$downloadURL = "https://fastdl.mongodb.org/windows/$BinaryName"
|
||||
$installArg = "INSTALLLOCATION=$installDir ADDLOCAL=all"
|
||||
Install-Binary -Url $downloadURL -Name $binaryName -ArgumentList ("/q","/i","${env:Temp}\$binaryName", $installArg)
|
||||
|
||||
|
||||
# Add mongodb to the PATH
|
||||
$mongodbService = "mongodb"
|
||||
|
||||
@@ -469,7 +469,7 @@
|
||||
"version": "5.7"
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "5.0.15"
|
||||
"version": "5.0"
|
||||
},
|
||||
"nsis": {
|
||||
"version": "3.08"
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
"version": "8.0"
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "5.0.15"
|
||||
"version": "5.0"
|
||||
},
|
||||
"nsis": {
|
||||
"version": "3.08"
|
||||
|
||||
Reference in New Issue
Block a user