From a4e2e6e920cf514de653325531842c5302549e16 Mon Sep 17 00:00:00 2001 From: Damien Gasparina Date: Tue, 3 Dec 2024 10:41:34 +0100 Subject: [PATCH] weaviate 1.27.6 (new formula) --- Formula/w/weaviate.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/w/weaviate.rb diff --git a/Formula/w/weaviate.rb b/Formula/w/weaviate.rb new file mode 100644 index 00000000000000..1593ccd3f73ad8 --- /dev/null +++ b/Formula/w/weaviate.rb @@ -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 + 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