2021-07-15 03:16:45 +00:00
|
|
|
class Docuum < Formula
|
|
|
|
desc "Perform least recently used (LRU) eviction of Docker images"
|
|
|
|
homepage "https://github.com/stepchowfun/docuum"
|
2021-08-15 20:25:16 +00:00
|
|
|
url "https://github.com/stepchowfun/docuum/archive/v0.20.3.tar.gz"
|
|
|
|
sha256 "a3a230ef718efb87eb5b42b0ffdaa87dd6df3ea64efe443e31c5fcf608a53580"
|
2021-07-15 03:16:45 +00:00
|
|
|
license "MIT"
|
|
|
|
|
2021-08-07 13:35:13 +00:00
|
|
|
bottle do
|
|
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1d31a9e6c05c8386800f6d318e926f03d8e451e6d86bd8c58adb1b1484fd4e0e"
|
|
|
|
sha256 cellar: :any_skip_relocation, big_sur: "5642aab3274b0bfb112c55f91e84004f9fae06196c85c11db299ba13ae25349c"
|
|
|
|
sha256 cellar: :any_skip_relocation, catalina: "3d3cc389fb68c4a90c8ab7276303a4ccf5aeeaa2aa25094450b49e50d750579e"
|
|
|
|
sha256 cellar: :any_skip_relocation, mojave: "0381a4f8be35a1bdf85af1cc10b5be22560ff44529b63bff32011d7362c78909"
|
2021-08-08 11:51:23 +00:00
|
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "b45019f50f39d1888dff2134f1d2ffd69bef5fd42b5db33f2130e5850cb5998e"
|
2021-08-07 13:35:13 +00:00
|
|
|
end
|
|
|
|
|
2021-07-15 03:16:45 +00:00
|
|
|
depends_on "rust" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cargo", "install", *std_cargo_args
|
|
|
|
end
|
|
|
|
|
2021-08-07 13:45:42 +00:00
|
|
|
# https://github.com/stepchowfun/docuum#configuring-your-operating-system-to-run-the-binary-as-a-daemon
|
|
|
|
service do
|
|
|
|
run opt_bin/"docuum"
|
|
|
|
keep_alive true
|
|
|
|
log_path var/"log/docuum.log"
|
|
|
|
error_log_path var/"log/docuum.log"
|
|
|
|
environment_variables PATH: std_service_path_env
|
|
|
|
end
|
|
|
|
|
2021-07-15 03:16:45 +00:00
|
|
|
test do
|
|
|
|
started_successfully = false
|
|
|
|
|
|
|
|
Open3.popen3({ "NO_COLOR" => "true" }, "#{bin}/docuum") do |_, _, stderr, wait_thread|
|
|
|
|
stderr.each_line do |line|
|
|
|
|
if line.include?("Performing an initial vacuum on startup…")
|
|
|
|
Process.kill("TERM", wait_thread.pid)
|
|
|
|
started_successfully = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
assert(started_successfully, "Docuum did not start successfully.")
|
|
|
|
end
|
|
|
|
end
|