Skip to content

Commit

Permalink
Merge pull request #768 from aaronparker/apps
Browse files Browse the repository at this point in the history
Apps
  • Loading branch information
aaronparker authored Nov 8, 2024
2 parents 9bc99cb + c32f33e commit 73870d8
Show file tree
Hide file tree
Showing 10 changed files with 183 additions and 66 deletions.
18 changes: 0 additions & 18 deletions Evergreen/Apps/Get-AzulZulu23.ps1

This file was deleted.

22 changes: 15 additions & 7 deletions Evergreen/Apps/Get-Gimp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ function Get-Gimp {
foreach ($Channel in $res.Get.Update.Channels) {

# Grab latest version, sort by descending version number
Write-Verbose -Message "$($MyInvocation.MyCommand): Channel: $Channel."
$Latest = $updateFeed.$Channel | `
Sort-Object -Property @{ Expression = { [System.Version]$_.version }; Descending = $true } | `
Select-Object -First 1
$MinorVersion = [System.Version] $Latest.version
try {
Write-Verbose -Message "$($MyInvocation.MyCommand): Get latest version for: $Channel."
$Latest = $updateFeed.$Channel | `
Sort-Object -Property @{ Expression = { [System.Version]$_.version }; Descending = $true } -ErrorAction "Stop" | `
Select-Object -First 1 -ErrorAction "Stop"
$MinorVersion = [System.Version] $Latest.version
Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: $($Latest.version)."
}
catch {
Write-Verbose -Message "$($MyInvocation.MyCommand): Fall back to first record for: $Channel."
$Latest = $updateFeed.$Channel | Select-Object -First 1
$MinorVersion = [System.Version] "$($Latest.version[0]).0"
}

if ($null -ne $Latest) {
# Grab the latest Windows Channel, sort by descending date
Expand All @@ -49,9 +57,9 @@ function Get-Gimp {
if ($null -ne $redirectUrl) {
$PSObject = [PSCustomObject] @{
Version = $Latest.version
Revision = if ([System.String]::IsNullOrEmpty($Latest.windows.revision)) { "0" } else { $Latest.windows.revision }
Channel = (Get-Culture).TextInfo.ToTitleCase($Channel.ToLower())
Revision = $(if ([System.String]::IsNullOrEmpty($Latest.windows.revision)) { "0" } else { $Latest.windows.revision[0] })
Date = ConvertTo-DateTime -DateTime $LatestWin.date -Pattern $res.Get.Update.DatePattern
Channel = (Get-Culture).TextInfo.ToTitleCase($Channel.ToLower())
Sha256 = $LatestWin.sha256
URI = $redirectUrl
}
Expand Down
45 changes: 45 additions & 0 deletions Evergreen/Apps/Get-mySQLConnectorNET.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function Get-mySQLConnectorNET {
<#
.NOTES
Author: BornToBeRoot
Twitter: @BornToBeRoot
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get latest repo tag
$Tags = Get-GitHubRepoTag -Uri $res.Get.Update.Uri

$Version = ($Tags | Sort-Object -Property @{ Expression = { [System.Version]$_.Tag }; Descending = $true } | Select-Object -First 1).Tag

# Build the output object
if ($Null -ne $Version) {
foreach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {

# https://dev.mysql.com/get/Downloads/Connector-ODBC/9.1/mysql-connector-odbc-9.1.0-winx64.msi
# redirect to
# https://cdn.mysql.com//Downloads/Connector-ODBC/9.1/mysql-connector-odbc-9.1.0-winx64.msi
#
# The sub path is only major.minor
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersionShort, (($Version -split '\.')[0, 1] -join '.') -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $CdnUri
}
Write-Output -InputObject $PSObject
}
}
}
44 changes: 44 additions & 0 deletions Evergreen/Apps/Get-mySQLConnectorODBC.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
function Get-mySQLConnectorODBC {
<#
.NOTES
Author: BornToBeRoot
Twitter: @BornToBeRoot
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get latest repo tag
$Tags = Get-GitHubRepoTag -Uri $res.Get.Update.Uri

$Version = ($Tags | Sort-Object -Property @{ Expression = { [System.Version]$_.Tag }; Descending = $true } | Select-Object -First 1).Tag

# Build the output object
if ($Null -ne $Version) {
foreach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {

# https://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-9.1.0.msi
# redirect to
# https://cdn.mysql.com//Downloads/Connector-Net/mysql-connector-net-9.1.0.msi
#
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $CdnUri
}
Write-Output -InputObject $PSObject
}
}
}
31 changes: 18 additions & 13 deletions Evergreen/Apps/Get-mySQLWorkbench.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-mySQLWorkbench {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name is a plural")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
Expand All @@ -14,24 +14,29 @@ function Get-mySQLWorkbench {
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params
# Get latest repo tag
$Tags = Get-GitHubRepoTag -Uri $res.Get.Update.Uri

$Version = ($Tags | Sort-Object -Property @{ Expression = { [System.Version]$_.Tag }; Descending = $true } | Select-Object -First 1).Tag

# Build the output object
if ($Null -ne $object) {
if ($Null -ne $Version) {
foreach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version

# https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-8.0.40-winx64.msi
# redirect to
# https://cdn.mysql.com//Downloads/MySQLGUITools/mysql-workbench-community-8.0.40-winx64.msi
#
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $object.Version
Version = $Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
URI = $CdnUri
}
Write-Output -InputObject $PSObject
}
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/EvergreenLibraryTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"Name": "MicrosoftOneDrive",
"EvergreenApp": "MicrosoftOneDrive",
"Filter": "$_.Architecture -eq \"x64\" -and $_.Ring -eq \"Production\" -and $_.Throttle -eq \"10\""
"Filter": "$_.Architecture -eq \"x64\" -and $_.Ring -eq \"Production\" -and $_.Throttle -eq \"100\""
},
{
"Name": "MicrosoftEdge",
Expand Down
23 changes: 0 additions & 23 deletions Evergreen/Manifests/AzulZulu23.json

This file was deleted.

29 changes: 29 additions & 0 deletions Evergreen/Manifests/mySQLConnectorNET.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Name": "mySQL Connector NET",
"Source": "https://dev.mysql.com/doc/connector-net/en/",
"Get": {
"Update": {
"Uri": "https://api.github.com/repos/mysql/mysql-connector-net/tags"
},
"Download": {
"Uri": {
"x64": "https://dev.mysql.com/get/Downloads/Connector-ODBC/#versionshort/mysql-connector-odbc-#version-winx64.msi"
},
"ReplaceVersion": "#version",
"ReplaceVersionShort": "#versionshort"
}
},
"Install": {
"Setup": "",
"Preinstall": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}

29 changes: 29 additions & 0 deletions Evergreen/Manifests/mySQLConnectorODBC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Name": "mySQL Connector ODCB",
"Source": "https://dev.mysql.com/doc/connector-odbc/en/",
"Get": {
"Update": {
"Uri": "https://api.github.com/repos/mysql/mysql-connector-odbc/tags"
},
"Download": {
"Uri": {
"x64": "https://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-#version.msi"
},
"ReplaceVersion": "#version"
}
},
"Install": {
"Setup": "",
"Preinstall": "",
"Physical": {
"Arguments": "",
"PostInstall": [
]
},
"Virtual": {
"Arguments": "",
"PostInstall": [
]
}
}
}
6 changes: 2 additions & 4 deletions Evergreen/Manifests/mySQLWorkbench.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
"Source": "https://dev.mysql.com/doc/workbench/en/",
"Get": {
"Update": {
"Uri": "https://api.github.com/repos/mysql/mysql-workbench/tags",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "\\.exe$"
"Uri": "https://api.github.com/repos/mysql/mysql-workbench/tags"
},
"Download": {
"Uri": {
"x64": "https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-#version-winx64.msi"
},
"ReplaceText": "#version"
"ReplaceVersion": "#version"
}
},
"Install": {
Expand Down

0 comments on commit 73870d8

Please sign in to comment.