Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Formula/w/wal-g.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class WalG < Formula
desc "Archival restoration tool for databases"
homepage "https://github.com/wal-g/wal-g"
url "https://github.com/wal-g/wal-g/archive/refs/tags/v3.0.7.tar.gz"
sha256 "69368316b90fae7c040e489ad540f6018d0f00963c5bc94d262d530e83bdd4ce"
license "Apache-2.0"

depends_on "go" => :build
depends_on "brotli"
depends_on "libsodium"
depends_on "lzo"

def install
%w[etcd fdb gp mongo mysql pg redis sqlserver].each do |db|
ldflags = %W[
-s -w
-X github.com/wal-g/wal-g/cmd/#{db}.buildDate=#{time.iso8601}
-X github.com/wal-g/wal-g/cmd/#{db}.gitRevision=#{tap.user}
-X github.com/wal-g/wal-g/cmd/#{db}.walgVersion=#{version}
]
output = bin/"wal-g-#{db}"
tags = %w[brotli libsodium lzo]
system "go", "build", *std_go_args(ldflags:, output:, tags:), "./main/#{db}"
end
end

test do
ENV["WALG_FILE_PREFIX"] = testpath

%w[etcd fdb gp mongo mysql pg redis sqlserver].each do |db|
assert_match version.to_s, shell_output("#{bin}/wal-g-#{db} --version")

flags = case db
when "gp"
"--config #{testpath}"
when "mongo"
"--mongodb-uri mongodb://"
end
assert_match "No backups found", shell_output("#{bin}/wal-g-#{db} backup-list #{flags} 2>&1")
end
end
end
Loading