diff --git a/.gitignore b/.gitignore index 32f64cf69..ae8fc4ac0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ mc /arkade-* /faas-cli* test.out -docker-compose.yaml \ No newline at end of file +docker-compose.yaml* \ No newline at end of file diff --git a/README.md b/README.md index 72d3c851f..bbd741015 100644 --- a/README.md +++ b/README.md @@ -760,6 +760,7 @@ There are 52 apps that you can install on your cluster. |------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [actions-usage](https://github.com/self-actuated/actions-usage) | Get usage insights from GitHub Actions. | | [actuated-cli](https://github.com/self-actuated/actuated-cli) | Official CLI for actuated.dev | +| [alloy](https://github.com/grafana/alloy) | OpenTelemetry Collector distribution with programmable pipelines | | [argocd](https://github.com/argoproj/argo-cd) | Declarative, GitOps continuous delivery tool for Kubernetes. | | [argocd-autopilot](https://github.com/argoproj-labs/argocd-autopilot) | An opinionated way of installing Argo-CD and managing GitOps repositories. | | [arkade](https://github.com/alexellis/arkade) | Portable marketplace for downloading your favourite DevOps CLIs and installing helm charts, with a single command. | @@ -920,6 +921,6 @@ There are 52 apps that you can install on your cluster. | [waypoint](https://github.com/hashicorp/waypoint) | Easy application deployment for Kubernetes and Amazon ECS | | [yq](https://github.com/mikefarah/yq) | Portable command-line YAML processor. | | [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Fork of youtube-dl with additional features and fixes | -There are 162 tools, use `arkade get NAME` to download one. +There are 163 tools, use `arkade get NAME` to download one. > Note to contributors, run `go build && ./arkade get --format markdown` to generate this list \ No newline at end of file diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index c8ad7729c..4a6e87916 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -8237,3 +8237,53 @@ func Test_Download_rclone(t *testing.T) { } } } + +func Test_Download_alloy(t *testing.T) { + tools := MakeTools() + name := "alloy" + const toolVersion = "v1.4.3" + + tool := getTool(name, tools) + + tests := []test{ + { + os: "darwin", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/grafana/alloy/releases/download/v1.4.3/alloy-darwin-amd64.zip", + }, + { + os: "darwin", + arch: archDarwinARM64, + version: toolVersion, + url: "https://github.com/grafana/alloy/releases/download/v1.4.3/alloy-darwin-arm64.zip", + }, + { + os: "linux", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/grafana/alloy/releases/download/v1.4.3/alloy-linux-amd64.zip", + }, + { + os: "linux", + arch: archARM64, + version: toolVersion, + url: "https://github.com/grafana/alloy/releases/download/v1.4.3/alloy-linux-arm64.zip", + }, + { + os: "mingw64_nt-10.0-18362", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/grafana/alloy/releases/download/v1.4.3/alloy-windows-amd64.exe.zip", + }, + } + for _, tc := range tests { + got, err := tool.GetURL(tc.os, tc.arch, tc.version, false) + if err != nil { + t.Fatal(err) + } + if got != tc.url { + t.Fatalf("\nwant: %s\ngot: %s", tc.url, got) + } + } +} diff --git a/pkg/get/tools.go b/pkg/get/tools.go index b18490ec3..fc238a14e 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -4467,5 +4467,51 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}} rclone-{{.Version}}-{{$os}}-{{$arch}}.{{$ext}} `, }) + + tools = append(tools, + Tool{ + Owner: "grafana", + Repo: "alloy", + Name: "alloy", + VersionStrategy: GitHubVersionStrategy, + Description: "OpenTelemetry Collector distribution with programmable pipelines", + URLTemplate: ` +{{$fileName := ""}} +{{- if eq .OS "linux" -}} + {{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{$fileName = "alloy-linux-arm64.zip"}} + {{ else if eq .Arch "x86_64" -}} + {{$fileName = "alloy-linux-amd64.zip"}} + {{- end -}} +{{- else if eq .OS "darwin" -}} + {{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{$fileName = "alloy-darwin-arm64.zip"}} + {{ else if eq .Arch "x86_64" -}} + {{$fileName = "alloy-darwin-amd64.zip"}} + {{- end -}} +{{- else if HasPrefix .OS "ming" -}} + {{$fileName = "alloy-windows-amd64.exe.zip"}} +{{- end -}} + +https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`, + + BinaryTemplate: ` +{{- if eq .OS "linux" -}} + {{- if eq .Arch "x86_64" -}} + {{.Name}}-linux-amd64 + {{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{.Name}}-linux-arm64 + {{- end -}} +{{- else if eq .OS "darwin" -}} + {{- if eq .Arch "x86_64" -}} + {{.Name}}-darwin-amd64 + {{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{.Name}}-darwin-arm64 + {{- end -}} +{{- else if HasPrefix .OS "ming" -}} + {{.Name}}-windows-amd64 + {{- end -}} + `, + }) return tools }