-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class Weaviate < Formula | ||
desc "Open-source vector database that stores both objects and vectors" | ||
homepage "https://weaviate.io/developers/weaviate/" | ||
url "https://github.com/weaviate/weaviate/archive/refs/tags/v1.27.6.tar.gz" | ||
sha256 "d8cad0339ccfd081be6afe1afd879f64bba224ed7ecbdb8b974853b536584330" | ||
license "BSD-3-Clause" | ||
|
||
depends_on "go" => :build | ||
|
||
def install | ||
ldflags = %W[ | ||
-s -w | ||
-X github.com/weaviate/weaviate/usecases/build.Version=#{version} | ||
-X github.com/weaviate/weaviate/usecases/build.BuildUser=#{tap.user} | ||
-X github.com/weaviate/weaviate/usecases/build.BuildDate=#{time.iso8601} | ||
] | ||
system "go", "build", *std_go_args(ldflags:), "./cmd/weaviate-server" | ||
end | ||
|
||
test do | ||
Check failure on line 20 in Formula/w/weaviate.rb GitHub Actions / macOS 14-x86_64`brew test --verbose weaviate` failed on macOS Sonoma (14)!
|
||
port = free_port | ||
pid = spawn bin/"weaviate", "--host", "0.0.0.0", "--port", port.to_s, "--scheme", "http" | ||
sleep 5 | ||
assert_match version.to_s, shell_output("curl localhost:#{port}/v1/meta") | ||
ensure | ||
Process.kill "TERM", pid | ||
Process.wait pid | ||
end | ||
end |