Skip to content

Commit

Permalink
Add run-job tool to arkade
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
  • Loading branch information
welteki authored and alexellis committed Sep 5, 2022
1 parent 308cd09 commit cd54f6a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -665,6 +665,7 @@ There are 56 apps that you can install on your cluster.
| promtool | Prometheus rule tester and debugging utility |
| rekor-cli | Secure Supply Chain - Transparency Log |
| rpk | Kafka compatible streaming platform for mission critical workloads. |
| run-job | Run a Kubernetes Job and get the logs when it's done. |
| sops | Simple and flexible tool for managing secrets |
| stern | Multi pod and container log tailing for Kubernetes. |
| talosctl | The command-line tool for managing Talos Linux OS. |
Expand All @@ -681,6 +682,6 @@ There are 56 apps that you can install on your cluster.
| waypoint | Easy application deployment for Kubernetes and Amazon ECS |
| yq | Portable command-line YAML processor. |

There are 103 tools, use `arkade get NAME` to download one.
There are 104 tools, use `arkade get NAME` to download one.

> Note to contributors, run `arkade get --output markdown` to generate this list
53 changes: 53 additions & 0 deletions pkg/get/get_test.go
Expand Up @@ -305,6 +305,59 @@ func Test_DownloadArkade(t *testing.T) {
}
}

func Test_DownloadRunJob(t *testing.T) {
tools := MakeTools()
name := "run-job"

var tool *Tool
for _, target := range tools {
if name == target.Name {
tool = &target
break
}
}

tests := []test{
{os: "mingw64_nt-10.0-18362",
arch: arch64bit,
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job.exe"},
{os: "darwin",
arch: arch64bit,
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-darwin"},
{os: "darwin",
arch: archDarwinARM64,
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-darwin-arm64"},
{os: "linux",
arch: arch64bit,
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job"},
{os: "linux",
arch: "armv6l",
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-armhf"},
{os: "linux",
arch: "armv7l",
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-armhf"},
{os: "linux",
arch: archARM64,
version: "0.0.1",
url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-arm64"},
}
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("want: %s, got: %s", tc.url, got)
}
}
}

func Test_DownloadKubectl(t *testing.T) {
tools := MakeTools()
name := "kubectl"
Expand Down
25 changes: 25 additions & 0 deletions pkg/get/tools.go
Expand Up @@ -351,6 +351,31 @@ https://storage.googleapis.com/kubernetes-release/release/{{.Version}}/bin/{{$os
{{- end -}}`,
})

tools = append(tools,
Tool{
Owner: "alexellis",
Repo: "run-job",
Name: "run-job",
Description: "Run a Kubernetes Job and get the logs when it's done.",
BinaryTemplate: `{{ if HasPrefix .OS "ming" -}}
{{.Name}}.exe
{{- else if eq .OS "darwin" -}}
{{ if eq .Arch "arm64" -}}
{{.Name}}-darwin-arm64
{{- else -}}
{{.Name}}-darwin
{{- end -}}
{{- else if eq .Arch "armv6l" -}}
{{.Name}}-armhf
{{- else if eq .Arch "armv7l" -}}
{{.Name}}-armhf
{{- else if eq .Arch "aarch64" -}}
{{.Name}}-arm64
{{- else -}}
{{.Name}}
{{- end -}}`,
})

tools = append(tools,
Tool{
Owner: "bitnami-labs",
Expand Down

0 comments on commit cd54f6a

Please sign in to comment.