Skip to content

Commit

Permalink
Merge pull request #606 from jms-du-se/main
Browse files Browse the repository at this point in the history
New apps: eduVPN and Clarivate Endnote
  • Loading branch information
aaronparker authored Dec 27, 2023
2 parents 334d025 + 36ab2b9 commit a128a1a
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Evergreen/Apps/Get-ClarivateEndnote.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
function Get-ClarivateEndNote {
<#
.SYNOPSIS
Get the current version and download URIs for the supported releases of Endnote.
.NOTES
Author: Jasper Metselaar
E-mail: [email protected]
#>
[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])
)

foreach ($Release in $res.Get.Update.Releases) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Release: $Release"
Write-Verbose -Message "$($MyInvocation.MyCommand): Endnote Update URL: $($res.Get.Update.Uri.$Release)"
Write-Verbose -Message "$($MyInvocation.MyCommand): Download URL: $($res.Get.Download.Uri.$Release)"

# Query the EndNote update API
$UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri.($Release)
if ($null -ne $UpdateFeed) {

# Sort the updates to find the latest
$Update = $UpdateFeed.updates.build | `
Sort-Object -Property @{ Expression = { [System.Version]$_.version }; Descending = $true } -ErrorAction "SilentlyContinue" | `
Select-Object -First 1

# Construct the output for the .exe installer; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Update.UpdateTo
Release = $Release
Type = Get-FileType -File $res.Get.Download.Uri.Exe.($Release)
URI = $res.Get.Download.Uri.Exe.($Release)
}
Write-Output -InputObject $PSObject

# Construct the output for the .msi installer; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Update.UpdateTo
Release = $Release
Type = Get-FileType -File $res.Get.Download.Uri.Msi.($Release)
URI = $res.Get.Download.Uri.Msi.($Release)
}
Write-Output -InputObject $PSObject

# Construct the output for the MSP patch; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Update.updateTo
Release = $Release
Type = Get-FileType -File $Update.url
URI = $Update.url
}
Write-Output -InputObject $PSObject
}
}
}
28 changes: 28 additions & 0 deletions Evergreen/Apps/Get-Eduvpn.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Function Get-eduVPN {
<#
.SYNOPSIS
Returns the latest EduVPN version number and download.
.NOTES
Author: Jasper Metselaar
E-mail: [email protected]
#>
[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
}
43 changes: 43 additions & 0 deletions Evergreen/Manifests/ClarivateEndnote.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"Name": "Clarivate EndNote",
"Source": "https://www.endnote.com/",
"Get": {
"Update": {
"Releases": [
"X9",
"20",
"21"
],
"Uri": {
"X9": "http://download.endnote.com/updates/19.0/EN19WinUpdates.xml",
"20": "https://download.endnote.com/updates/20.0/EN20WinUpdates.xml",
"21": "https://download.endnote.com/updates/21.0/EN21WinUpdates.xml"
}
},
"Download": {
"Uri": {
"Exe": {
"X9": "https://download.endnote.com/downloads/X9/ENX9Inst.exe",
"20": "https://download.endnote.com/downloads/20/EN20Inst.exe",
"21": "https://download.endnote.com/downloads/21/EN21Inst.exe"
},
"Msi": {
"X9": "https://download.endnote.com/downloads/X9/ENX9Inst.msi",
"20": "https://download.endnote.com/downloads/20/EN20Inst.msi",
"21": "https://download.endnote.com/downloads/21/EN21Inst.msi"
}
}
}
},
"Install": {
"Setup": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
23 changes: 23 additions & 0 deletions Evergreen/Manifests/Eduvpn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Name": "eduVPN",
"Source": "https://app.eduvpn.org/",
"Get": {
"Uri": "https://api.github.com/repos/Amebis/eduVPN/releases/latest",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "eduVPNClient_.*(exe|msi)$"
},
"Install": {
"Setup": "eduVPNClient_*.exe",
"Preinstall": "",
"Physical": {
"Arguments": "/install /quiet /norestart",
"PostInstall": [
]
},
"Virtual": {
"Arguments": "",
"PostInstall": [
]
}
}
}

0 comments on commit a128a1a

Please sign in to comment.