diff --git a/README.md b/README.md index 64b4ed2e4..b69afcc01 100644 --- a/README.md +++ b/README.md @@ -858,6 +858,7 @@ There are 56 apps that you can install on your cluster. | [kwok](https://github.com/kubernetes-sigs/kwok) | KWOK stands for Kubernetes WithOut Kubelet, responsible for simulating the lifecycle of fake nodes, pods, and other Kubernetes API resources | | [kwokctl](https://github.com/kubernetes-sigs/kwok) | CLI tool designed to streamline the creation and management of clusters, with nodes simulated by `kwok` | | [kyverno](https://github.com/kyverno/kyverno) | CLI to apply and test Kyverno policies outside a cluster. | +| [lazydocker](https://github.com/jesseduffield/lazydocker) | A simple terminal UI for both docker and docker-compose, written in Go with the gocui library. | | [lazygit](https://github.com/jesseduffield/lazygit) | A simple terminal UI for git commands. | | [linkerd2](https://github.com/linkerd/linkerd2) | Ultralight, security-first service mesh for Kubernetes. | | [mc](https://github.com/minio/mc) | MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage. | @@ -916,6 +917,6 @@ There are 56 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 154 tools, use `arkade get NAME` to download one. +There are 155 tools, use `arkade get NAME` to download one. > Note to contributors, run `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 e0c57f7cb..0c7603a4e 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -7679,3 +7679,98 @@ func Test_DownloadKubeColor(t *testing.T) { } } + +func Test_DownloadLazyDocker(t *testing.T) { + tools := MakeTools() + name := "lazydocker" + + tool := getTool(name, tools) + + const toolVersion = "v0.23.3" + + tests := []test{ + { + os: "linux", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_x86_64.tar.gz", + }, + { + os: "linux", + arch: archARM64, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_arm64.tar.gz", + }, + { + os: "linux", + arch: "armv6l", + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_armv6.tar.gz", + }, + { + os: "linux", + arch: archARM7, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_armv7.tar.gz", + }, + { + os: "darwin", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_x86_64.tar.gz", + }, + { + os: "darwin", + arch: archDarwinARM64, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_arm64.tar.gz", + }, + { + os: "darwin", + arch: "armv6l", + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_armv6.tar.gz", + }, + { + os: "darwin", + arch: archARM7, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_armv7.tar.gz", + }, + { + os: "ming", + arch: archARM64, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_arm64.zip", + }, + { + os: "ming", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_x86_64.zip", + }, + { + os: "ming", + arch: "armv6l", + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_armv6.zip", + }, + { + os: "ming", + arch: archARM7, + version: toolVersion, + url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_armv7.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.Errorf("\nwant: %s, \n got: %s", tc.url, got) + } + } + +} diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 504b70131..e835d3f8d 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -4244,5 +4244,39 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}} {{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.{{$ext}}`, }) + tools = append(tools, + Tool{ + Owner: "jesseduffield", + Repo: "lazydocker", + Name: "lazydocker", + Description: "A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.", + BinaryTemplate: ` + {{$os := .OS}} + {{$arch := .Arch}} + {{$ext := "tar.gz"}} + + {{ if HasPrefix .OS "ming" -}} + {{$ext = "zip"}} + {{- end -}} + + {{- if eq .Arch "aarch64" -}} + {{$arch = "arm64"}} + {{- else if eq .Arch "armv6l" -}} + {{ $arch = "armv6" }} + {{- else if eq .Arch "armv7l" -}} + {{ $arch = "armv7" }} + {{- end -}} + + {{$osStr := ""}} + {{ if HasPrefix .OS "ming" -}} + {{$osStr = "Windows"}} + {{- else if eq .OS "linux" -}} + {{$osStr = "Linux"}} + {{- else if eq .OS "darwin" -}} + {{$osStr = "Darwin"}} + {{- end -}} + + {{.Name}}_{{.VersionNumber}}_{{$osStr}}_{{$arch}}.{{$ext}}`, + }) return tools }