Skip to content

Commit 823a2e5

Browse files
committed
wal-g 3.0.7 (new formula)
1 parent 816385d commit 823a2e5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Formula/w/wal-g.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
class WalG < Formula
2+
desc "Archival restoration tool for databases"
3+
homepage "https://github.com/wal-g/wal-g"
4+
url "https://github.com/wal-g/wal-g/archive/refs/tags/v3.0.7.tar.gz"
5+
sha256 "69368316b90fae7c040e489ad540f6018d0f00963c5bc94d262d530e83bdd4ce"
6+
license "Apache-2.0"
7+
8+
depends_on "go" => :build
9+
depends_on "brotli"
10+
depends_on "libsodium"
11+
depends_on "lzo"
12+
13+
def install
14+
%w[etcd fdb gp mongo mysql pg redis sqlserver].each do |db|
15+
ldflags = %W[
16+
-s -w
17+
-X github.com/wal-g/wal-g/cmd/#{db}.buildDate=#{time.iso8601}
18+
-X github.com/wal-g/wal-g/cmd/#{db}.gitRevision=#{tap.user}
19+
-X github.com/wal-g/wal-g/cmd/#{db}.walgVersion=#{version}
20+
]
21+
output = bin/"wal-g-#{db}"
22+
tags = %w[brotli libsodium lzo]
23+
system "go", "build", *std_go_args(ldflags:, output:, tags:), "./main/#{db}"
24+
end
25+
end
26+
27+
test do
28+
ENV["WALG_FILE_PREFIX"] = testpath
29+
30+
%w[etcd fdb gp mongo mysql pg redis sqlserver].each do |db|
31+
assert_match version.to_s, shell_output("#{bin}/wal-g-#{db} --version")
32+
33+
flags = case db
34+
when "gp"
35+
"--config #{testpath}"
36+
when "mongo"
37+
"--mongodb-uri mongodb://"
38+
end
39+
assert_match "No backups found", shell_output("#{bin}/wal-g-#{db} backup-list #{flags} 2>&1")
40+
end
41+
end
42+
end

0 commit comments

Comments
 (0)