Skip to content

Commit

Permalink
add support for faasd
Browse files Browse the repository at this point in the history
Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com>
  • Loading branch information
nitishkumar71 authored and alexellis committed Mar 29, 2024
1 parent 6cf4a64 commit 8886a74
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ There are 56 apps that you can install on your cluster.
| [eksctl-anywhere](https://github.com/aws/eks-anywhere) | Run Amazon EKS on your own infrastructure |
| [etcd](https://github.com/etcd-io/etcd) | Distributed reliable key-value store for the most critical data of a distributed system. |
| [faas-cli](https://github.com/openfaas/faas-cli) | Official CLI for OpenFaaS. |
| [faasd](https://github.com/openfaas/faasd) | faasd - a lightweight & portable faas engine |
| [firectl](https://github.com/firecracker-microvm/firectl) | Command-line tool that lets you run arbitrary Firecracker MicroVMs |
| [flux](https://github.com/fluxcd/flux2) | Continuous Delivery solution for Kubernetes powered by GitOps Toolkit. |
| [flyctl](https://github.com/superfly/flyctl) | Command line tools for fly.io services |
Expand Down Expand Up @@ -911,6 +912,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 151 tools, use `arkade get NAME` to download one.
There are 152 tools, use `arkade get NAME` to download one.

> Note to contributors, run `arkade get --format markdown` to generate this list
39 changes: 39 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7199,3 +7199,42 @@ func Test_DownloadRegCtl(t *testing.T) {
}
}
}

func Test_DownloadFaasd(t *testing.T) {
tools := MakeTools()
name := "faasd"
const version = "0.18.8"

tool := getTool(name, tools)

tests := []test{
{
os: "linux",
arch: arch64bit,
version: version,
url: `https://github.com/openfaas/faasd/releases/download/0.18.8/faasd`,
},
{
os: "linux",
arch: archARM64,
version: version,
url: `https://github.com/openfaas/faasd/releases/download/0.18.8/faasd-arm64`,
},
{
os: "linux",
arch: archARM7,
version: version,
url: `https://github.com/openfaas/faasd/releases/download/0.18.8/faasd-armhf`,
},
}

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("want: %s, got: %s", tc.url, got)
}
}
}
58 changes: 39 additions & 19 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4126,25 +4126,45 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}}
Name: "regctl",
Description: "Utility for accessing docker registries",
BinaryTemplate: `
{{ $os := .OS }}
{{ $arch := .Arch }}
{{ $ext := "" }}
{{- if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "arm64" -}}
{{ $arch = "arm64" }}
{{- else if eq .Arch "x86_64" -}}
{{ $arch = "amd64" }}
{{- end -}}
{{ if HasPrefix .OS "ming" -}}
{{$os = "windows"}}
{{$ext = ".exe"}}
{{- end -}}
regctl-{{$os}}-{{$arch}}{{$ext}}
`,
{{ $os := .OS }}
{{ $arch := .Arch }}
{{ $ext := "" }}
{{- if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "arm64" -}}
{{ $arch = "arm64" }}
{{- else if eq .Arch "x86_64" -}}
{{ $arch = "amd64" }}
{{- end -}}
{{ if HasPrefix .OS "ming" -}}
{{$os = "windows"}}
{{$ext = ".exe"}}
{{- end -}}
regctl-{{$os}}-{{$arch}}{{$ext}}
`,
})

tools = append(tools,
Tool{
Owner: "openfaas",
Repo: "faasd",
Name: "faasd",
Description: "faasd - a lightweight & portable faas engine",
BinaryTemplate: `
{{$arch := ""}}
{{- if or (eq .Arch "aarch64") (eq .Arch "arm64") -}}
{{$arch = "-arm64"}}
{{- else if or (eq .Arch "armv6l") (eq .Arch "armv7l") -}}
{{$arch = "-armhf"}}
{{- end -}}
{{.Name}}{{$arch}}
`,
})

return tools
}

0 comments on commit 8886a74

Please sign in to comment.