Skip to content

Commit

Permalink
Merge pull request #744 from aaronparker/apps
Browse files Browse the repository at this point in the history
Apps
  • Loading branch information
aaronparker authored Sep 22, 2024
2 parents f79bcb4 + 28d7538 commit 9c03716
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 52 deletions.
28 changes: 28 additions & 0 deletions Evergreen/Apps/Get-NavimaticsWinFSP.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function Get-NavimaticsWinFSP {
<#
.SYNOPSIS
Get the current version and download URL for WinSFP.
.NOTES
Site: https://winfsp.dev/rel/
Author: Alex Harvey
GitHub: @alex-harvey-z3q
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
18 changes: 18 additions & 0 deletions Evergreen/Apps/Get-OracleJava23.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function Get-OracleJava23 {
<#
.NOTES
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

$Output = Get-OracleJava -res $res
Write-Output -InputObject $Output
}
45 changes: 45 additions & 0 deletions Evergreen/Apps/Get-PositRStudio.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function Get-PositRStudio {
<#
.SYNOPSIS
Returns the available RStudio version and download URI.
.NOTES
Author: Andrew Cooper
Twitter: @adotcoop
Based on Get-AtlassianBitbucket.ps1
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Read the download URI
$Content = Invoke-EvergreenRestMethod -Uri $res.Get.Download.Uri
if ($Content -is [PSCustomObject]) {

# Step through each installer type
foreach ($Product in $res.Get.Download.Products) {

# Build the output object; Output object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Content.rstudio.$Product.stable.desktop.installer.windows.version
Date = ConvertTo-DateTime -DateTime $Content.rstudio.$Product.stable.desktop.installer.windows.last_modified -Pattern "yyyy-MM-dd"
Pro = $Content.rstudio.$Product.stable.desktop.installer.windows.pro
ProductName = $Content.rstudio.$Product.stable.desktop.installer.windows.label
Size = $Content.rstudio.$Product.stable.desktop.installer.windows.size
Sha256 = $Content.rstudio.$Product.stable.desktop.installer.windows.sha256
Type = Get-FileType -File $Content.rstudio.$Product.stable.desktop.installer.windows.url
URI = $Content.rstudio.$Product.stable.desktop.installer.windows.url
}
Write-Output -InputObject $PSObject
}
}
else {
Write-Error -Message "$($MyInvocation.MyCommand): Data returned from update URI is not expected format: $($res.Get.Download.Uri)."
return
}
}
39 changes: 0 additions & 39 deletions Evergreen/Apps/Get-RStudio.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions Evergreen/Evergreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"ErrorAction": "Stop"
},
"UserAgent": {
"Base": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.2592.87",
"Base": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Download": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.2592.87",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Googlebot/2.1 (+http://www.google.com/bot.html)"
],
"CatchList": [
Expand Down
20 changes: 20 additions & 0 deletions Evergreen/Manifests/NavimaticsWinFSP.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Name": "Navimatics WinFSP",
"Source": "https://winfsp.dev/rel/",
"Get": {
"Uri": "https://api.github.com/repos/winfsp/winfsp/releases/latest",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "\\.msi$"
},
"Install": {
"Setup": "winfsp-*.msi",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
2 changes: 1 addition & 1 deletion Evergreen/Manifests/OracleJava17.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"cache-control": "max-age=0",
"authority": "www.java.com"
},
"UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.81",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Family": 17,
"DateFormat": "yyyy-MM-dd"
},
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Manifests/OracleJava20.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"cache-control": "max-age=0",
"authority": "www.java.com"
},
"UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.81",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Family": 20,
"DateFormat": "yyyy-MM-dd"
},
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Manifests/OracleJava21.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"cache-control": "max-age=0",
"authority": "www.java.com"
},
"UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.81",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Family": 21,
"DateFormat": "yyyy-MM-dd"
},
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Manifests/OracleJava22.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"cache-control": "max-age=0",
"authority": "www.java.com"
},
"UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.81",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Family": 22,
"DateFormat": "yyyy-MM-dd"
},
Expand Down
40 changes: 40 additions & 0 deletions Evergreen/Manifests/OracleJava23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"Name": "Oracle Java 23",
"Source": "https://www.oracle.com/java/technologies/downloads/#java23",
"Get": {
"Update": {
"Uri": "https://www.java.com/releases/releases.json",
"Headers": {
"scheme": "https",
"accept-language": "en-AU,en-GB;q=0.9,en;q=0.8,en-US;q=0.7",
"accept-encoding": "gzip, deflate, br",
"method": "GET",
"path": "/releases/releases.json",
"accept": "application/json",
"cache-control": "max-age=0",
"authority": "www.java.com"
},
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105",
"Family": 23,
"DateFormat": "yyyy-MM-dd"
},
"Download": {
"Uri": {
"zip": "https://download.oracle.com/java/23/latest/jdk-23_windows-x64_bin.zip",
"exe": "https://download.oracle.com/java/23/latest/jdk-23_windows-x64_bin.exe",
"msi": "https://download.oracle.com/java/23/latest/jdk-23_windows-x64_bin.msi"
}
}
},
"Install": {
"Setup": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "RStudio Desktop",
"Name": "Posit RStudio Desktop",
"Source": "https://posit.co/products/open-source/rstudio/",
"Get": {
"Download": {
"Uri": "https://www.rstudio.com/wp-content/downloads.json",
"Uri": "https://posit.co/wp-content/uploads/downloads.json",
"Products": [
"open_source",
"pro"
Expand Down
10 changes: 6 additions & 4 deletions Evergreen/Shared/Get-OracleJava.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ function Get-OracleJava {
}

[PSCustomObject] @{
Version = $LatestVersion.version
Sha256 = $Sha256
Type = Get-FileType -File $res.Get.Download.Uri[$Type.Key]
URI = $res.Get.Download.Uri[$Type.Key]
Version = $LatestVersion.version
FullVersion = $LatestVersion.fullversion
Date = ConvertTo-DateTime -DateTime $LatestVersion.ga -Pattern $res.Get.Update.DateFormat
Sha256 = $Sha256
Type = Get-FileType -File $res.Get.Download.Uri[$Type.Key]
URI = $res.Get.Download.Uri[$Type.Key]
} | Write-Output
}
}
2 changes: 1 addition & 1 deletion scripts/Invoke-Download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Invoke-Download {
[Parameter(Position = 2)]
[System.String] $FileName,

[System.String[]] $UserAgent = @('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36', 'Googlebot/2.1 (+http://www.google.com/bot.html)'),
[System.String[]] $UserAgent = @('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/127.0.2651.105', 'Googlebot/2.1 (+http://www.google.com/bot.html)'),

[System.String] $TempPath = [System.IO.Path]::GetTempPath(),

Expand Down

0 comments on commit 9c03716

Please sign in to comment.