Skip to content

Commit

Permalink
feat(inlets-pro): support installation of inlets-pro CLI
Browse files Browse the repository at this point in the history
inlets-pro CLI added as tool to the project

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
  • Loading branch information
developer-guy authored and alexellis committed May 5, 2021
1 parent 89c4c8e commit b37cb7a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -68,6 +68,7 @@ Use "arkade get TOOL" to download a tool or application:
helmfile
hugo
inletsctl
inlets-pro
k3d
k3sup
k9s
Expand Down
45 changes: 45 additions & 0 deletions pkg/get/get_test.go
Expand Up @@ -1335,3 +1335,48 @@ func Test_DownloadTektonCli(t *testing.T) {
}
}
}

func Test_DownloandInletsProCli(t *testing.T) {
tools := MakeTools()
name := "inlets-pro"

tool := getTool(name, tools)

tests := []test{
{
os: "ming",
arch: arch64bit,
version: "0.8.3",
url: `https://github.com/inlets/inlets-pro/releases/download/0.8.3/inlets-pro.exe`,
},
{
os: "linux",
arch: arch64bit,
version: "0.8.3",
url: `https://github.com/inlets/inlets-pro/releases/download/0.8.3/inlets-pro`,
},
{
os: "linux",
arch: archARM64,
version: "0.8.3",
url: `https://github.com/inlets/inlets-pro/releases/download/0.8.3/inlets-pro-arm64`,
},
{
os: "darwin",
arch: arch64bit,
version: "0.8.3",
url: `https://github.com/inlets/inlets-pro/releases/download/0.8.3/inlets-pro-darwin`,
},
}

for _, tc := range tests {
got, err := tool.GetURL(tc.os, tc.arch, tc.version)
if err != nil {
t.Fatal(err)
}
if got != tc.url {
t.Errorf("want: %s, got: %s", tc.url, got)
}
}

}
20 changes: 20 additions & 0 deletions pkg/get/tools.go
Expand Up @@ -1023,5 +1023,25 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
https://github.com/{{.Owner}}/{{.Repo}}/releases/download/v{{.Version}}/tkn_{{.Version}}_{{$osString}}_{{$arch}}{{$ext}}`,
})

tools = append(tools,
Tool{
Owner: "inlets",
Repo: "inlets-pro",
Name: "inlets-pro",
BinaryTemplate: `{{ if HasPrefix .OS "ming" -}}
{{.Name}}.exe
{{- else if eq .OS "darwin" -}}
{{.Name}}-darwin
{{- else if eq .Arch "armv6l" -}}
{{.nAME}}-armhf
{{- else if eq .Arch "armv7l" -}}
{{.Name}}-armhf
{{- else if eq .Arch "aarch64" -}}
{{.Name}}-arm64
{{- else -}}
{{.Name}}
{{- end -}}`,
})

return tools
}

0 comments on commit b37cb7a

Please sign in to comment.