Skip to content

Commit 8b17fc0

Browse files
[Windows] Update MongoDB to 7.0 on windows-2022 (#13125)
1 parent 4fb55a7 commit 8b17fc0

File tree

5 files changed

+19
-29
lines changed

5 files changed

+19
-29
lines changed

images/windows/scripts/build/Install-MongoDB.ps1

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,18 @@ $mongodbService.WaitForStatus('Running', '00:01:00')
3939
Stop-Service $mongodbService
4040
$mongodbService | Set-Service -StartupType Disabled
4141

42-
# Install mongodb shell for mongodb > 5 version
43-
if (Test-IsWin25) {
44-
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
45-
46-
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
47-
-Repo "mongodb-js/mongosh" `
48-
-Version $mongoshVersion `
49-
-UrlMatchPattern "mongosh-*-x64.msi"
50-
51-
Install-Binary -Type MSI `
52-
-Url $mongoshDownloadUrl `
53-
-ExtraInstallArgs @('ALLUSERS=1') `
54-
-ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US'
55-
}
42+
# Install mongodb shell for mongodb
43+
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
44+
45+
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
46+
-Repo "mongodb-js/mongosh" `
47+
-Version $mongoshVersion `
48+
-UrlMatchPattern "mongosh-*-x64.msi"
49+
50+
Install-Binary -Type MSI `
51+
-Url $mongoshDownloadUrl `
52+
-ExtraInstallArgs @('ALLUSERS=1') `
53+
-ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US'
54+
5655

5756
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"

images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ $databaseTools.AddToolVersion("DacFx", $(Get-DacFxVersion))
193193
$databaseTools.AddToolVersion("MySQL", $(Get-MySQLVersion))
194194
$databaseTools.AddToolVersion("SQL OLEDB Driver", $(Get-SQLOLEDBDriverVersion))
195195
$databaseTools.AddToolVersion("SQLPS", $(Get-SQLPSVersion))
196-
if (Test-IsWin25) {
197-
$databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion))
198-
}
196+
$databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion))
197+
199198

200199
# Web Servers
201200
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersSection))

images/windows/scripts/docs-gen/SoftwareReport.Databases.psm1

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ function Get-PostgreSQLTable
2121
function Get-MongoDBTable
2222
{
2323
$name = "MongoDB"
24-
if (Test-IsWin25) {
25-
$command = "mongod"
26-
} else {
27-
$command = "mongo"
28-
}
24+
$command = "mongod"
2925
$mongoService = Get-Service -Name $name
3026
$mongoVersion = (Get-Command -Name $command).Version.ToString()
3127
return [PSCustomObject]@{

images/windows/scripts/tests/Databases.Tests.ps1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
Describe "MongoDB" {
22
Context "Version" {
33
It "<ToolName>" -TestCases @(
4-
if (Test-IsWin25) {
5-
@{ ToolName = "mongos" }
6-
} else {
7-
@{ ToolName = "mongo" }
8-
}
4+
@{ ToolName = "mongos" }
95
@{ ToolName = "mongod" }
106
) {
117
$toolsetVersion = (Get-ToolsetContent).mongodb.version
@@ -30,7 +26,7 @@ Describe "MongoDB" {
3026
}
3127
}
3228

33-
Context "Shell" -Skip:(-not (Test-IsWin25)) {
29+
Context "Shell" {
3430
It "mongosh" {
3531
"mongosh --version" | Should -ReturnZeroExitCode
3632
}

images/windows/toolsets/toolset-2022.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
"version": "8.0"
346346
},
347347
"mongodb": {
348-
"version": "5.0"
348+
"version": "7.0"
349349
},
350350
"nsis": {
351351
"version": "3.10"

0 commit comments

Comments
 (0)