diff --git a/Evergreen/Apps/Get-GrafanaAgent.ps1 b/Evergreen/Apps/Get-GrafanaAgent.ps1 new file mode 100644 index 00000000..1a88a1e2 --- /dev/null +++ b/Evergreen/Apps/Get-GrafanaAgent.ps1 @@ -0,0 +1,24 @@ +function Get-GrafanaAgent { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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 +} diff --git a/Evergreen/Manifests/GrafanaAgent.json b/Evergreen/Manifests/GrafanaAgent.json new file mode 100644 index 00000000..ebb095bf --- /dev/null +++ b/Evergreen/Manifests/GrafanaAgent.json @@ -0,0 +1,23 @@ +{ + "Name": "Grafana Agent", + "Source": "https://grafana.com/docs/agent/", + "Get": { + "Uri": "https://api.github.com/repos/grafana/agent/releases/latest", + "MatchVersion": "(\\d+(\\.\\d+){1,4}).*", + "MatchFileTypes": "\\.exe$|\\.msi$|\\.zip$" + }, + "Install": { + "Setup": "", + "Preinstall": "", + "Physical": { + "Arguments": "", + "PostInstall": [ + ] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [ + ] + } + } +}