-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrone-ssh.rb
43 lines (36 loc) · 1.32 KB
/
drone-ssh.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class DroneSsh < Formula
desc "Execute commands on a remote host through SSH"
homepage "https://github.com/appleboy/drone-ssh"
version "1.8.0"
os = OS.mac? ? "darwin" : "linux"
arch = case Hardware::CPU.arch
when :x86_64 then "amd64"
when :arm64 then "arm64"
else
raise "drone-ssh: Unsupported system architecture #{Hardware::CPU.arch}"
end
@@filename = "drone-ssh-#{version}-#{os}-#{arch}"
@@url = "https://github.com/appleboy/drone-ssh/releases/download/v#{version}/#{@@filename}"
@@url += ".xz"
@@using = nil
depends_on "xz"
@@sha256 = case "#{os}-#{arch}"
when "linux-amd64" then "794225f55d6542e569cc6fb02ba10855741db378fe60d517da92b7672c23da29"
when "linux-arm64" then "ef6c940839abda77a8c7cec9b3ad81ace7210221a568148f8bcb290191932cda"
when "darwin-amd64" then "c1a00985cfa9394b751759dad1591a3916b9adf33e2c641413364c6a53cd98f2"
when "darwin-arm64" then "7e4695230066696a04338488a0030ff1c256d1951cb0de390f165b359d750765"
else
raise "drone-ssh: Unsupported system #{os}-#{arch}"
end
sha256 @@sha256
url @@url,
using: @@using
depends_on "zsh" => :optional
def install
filename = DroneSsh.class_variable_get("@@filename")
bin.install filename => "drone-ssh"
end
test do
system "#{bin}/drone-ssh", "version"
end
end