Skip to content

Commit

Permalink
Merge pull request #615 from g3rhard/podman_desktop
Browse files Browse the repository at this point in the history
Add Podman Desktop
  • Loading branch information
aaronparker authored Feb 12, 2024
2 parents 39997c1 + 29d5675 commit 26beec9
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Evergreen/Apps/Get-PodmanDesktop.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Function Get-PodmanDesktop {
<#
.SYNOPSIS
Returns the available Podman Desktop versions.
.NOTES
Author: Kirill Trofimov
#>
[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

# For windows there are two different .exe versions.
foreach ($o in $object) {
if (-not($o.URI.contains("setup")) -and $o.URI.EndsWith(".exe")) {
$o.InstallerType = "Portable"
}
}

Write-Output -InputObject $object
}
20 changes: 20 additions & 0 deletions Evergreen/Manifests/PodmanDesktop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Name": "Podman Desktop",
"Source": "https://github.com/containers/podman-desktop",
"Get": {
"Uri": "https://api.github.com/repos/containers/podman-desktop/releases/latest",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "\\.exe$"
},
"Install": {
"Setup": "podman-desktop*.exe",
"Physical": {
"Arguments": "/S",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
1 change: 1 addition & 0 deletions Evergreen/Private/Get-InstallerType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function Get-InstallerType {
"portable" { $Type = "Portable"; break }
"no-installer" { $Type = "Portable"; break }
"debug" { $Type = "Debug"; break }
"airgap" { $Type = "Airgap"; break }
default {
Write-Verbose -Message "$($MyInvocation.MyCommand): Installer type not found in $String, defaulting to 'Default'."
$Type = "Default"
Expand Down
8 changes: 8 additions & 0 deletions tests/Private/Get-InstallerType.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,13 @@ Describe -Name "Get-InstallerType" {
Get-InstallerType -String $Url | Should -Be "Debug"
}
}

It "Returns Airgap given an airgap URL" {
InModuleScope -ModuleName "Evergreen" {
$Url = "https://github.com/containers/podman-desktop/releases/download/v1.6.4/podman-desktop-airgap-1.6.4-x64.exe"
Get-InstallerType -String $Url | Should -Be "Airgap"
}
}

}
}

0 comments on commit 26beec9

Please sign in to comment.