Skip to content

Commit a120f8c

Browse files
committed
Add dufs
Closes: #1145 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent b2def6b commit a120f8c

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

pkg/get/get_test.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,47 @@ func Test_DownloadCivo(t *testing.T) {
16131613
}
16141614
}
16151615

1616+
func Test_DownloadDufs(t *testing.T) {
1617+
tools := MakeTools()
1618+
name := "dufs"
1619+
1620+
tool := getTool(name, tools)
1621+
1622+
const toolVersion = "v0.45.0"
1623+
1624+
tests := []test{
1625+
{os: "mingw64_nt-10.0-18362",
1626+
arch: arch64bit,
1627+
version: toolVersion,
1628+
url: "https://github.com/sigoden/dufs/releases/download/v0.45.0/dufs-v0.45.0-x86_64-pc-windows-msvc.zip"},
1629+
{os: "linux",
1630+
arch: arch64bit,
1631+
version: toolVersion,
1632+
url: "https://github.com/sigoden/dufs/releases/download/v0.45.0/dufs-v0.45.0-x86_64-unknown-linux-musl.tar.gz"},
1633+
{os: "linux",
1634+
arch: archARM64,
1635+
version: toolVersion,
1636+
url: "https://github.com/sigoden/dufs/releases/download/v0.45.0/dufs-v0.45.0-aarch64-unknown-linux-musl.tar.gz"},
1637+
{os: "darwin",
1638+
arch: arch64bit,
1639+
version: toolVersion,
1640+
url: "https://github.com/sigoden/dufs/releases/download/v0.45.0/dufs-v0.45.0-x86_64-apple-darwin.tar.gz"},
1641+
{os: "darwin",
1642+
arch: archDarwinARM64,
1643+
version: toolVersion,
1644+
url: "https://github.com/sigoden/dufs/releases/download/v0.45.0/dufs-v0.45.0-aarch64-apple-darwin.tar.gz"},
1645+
}
1646+
for _, tc := range tests {
1647+
got, _, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
1648+
if err != nil {
1649+
t.Fatal(err)
1650+
}
1651+
if got != tc.url {
1652+
t.Fatalf("want: %s, got: %s", tc.url, got)
1653+
}
1654+
}
1655+
}
1656+
16161657
func Test_DownloadWaypoint(t *testing.T) {
16171658
tools := MakeTools()
16181659
name := "waypoint"

pkg/get/tools.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,21 @@ https://dl.k8s.io/release/{{.Version}}/bin/{{$os}}/{{$arch}}/kubectl{{$ext}}`})
370370
{{$binary}}`,
371371
})
372372

373+
tools = append(tools,
374+
Tool{
375+
Owner: "sigoden",
376+
Repo: "dufs",
377+
Name: "dufs",
378+
Description: "A file server that supports static serving, uploading",
379+
BinaryTemplate: `{{ if HasPrefix .OS "ming" -}}
380+
{{.Name}}-{{.Version}}-{{.Arch}}-pc-windows-msvc.zip
381+
{{- else if eq .OS "darwin" -}}
382+
{{.Name}}-{{.Version}}-{{if eq .Arch "arm64"}}aarch64{{else}}{{.Arch}}{{end}}-apple-darwin.tar.gz
383+
{{- else if eq .OS "linux" -}}
384+
{{.Name}}-{{.Version}}-{{if eq .Arch "arm64"}}aarch64{{else}}{{.Arch}}{{end}}-unknown-linux-musl.tar.gz
385+
{{- end -}}`,
386+
})
387+
373388
tools = append(tools,
374389
Tool{
375390
Owner: "tilt-dev",

0 commit comments

Comments
 (0)