Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add alloy to tools #1138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ mc
/arkade-*
/faas-cli*
test.out
docker-compose.yaml
docker-compose.yaml*
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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
50 changes: 50 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
46 changes: 46 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}