2019-07-26 19:24:18 +00:00
|
|
|
class Dive < Formula
|
|
|
|
desc "Tool for exploring each layer in a docker image"
|
|
|
|
homepage "https://github.com/wagoodman/dive"
|
|
|
|
url "https://github.com/wagoodman/dive.git",
|
2019-11-09 16:44:55 +00:00
|
|
|
:tag => "v0.9.1",
|
|
|
|
:revision => "bfcfc54ee34b623274a91ca48379ac229b5415c2"
|
2019-07-26 19:24:18 +00:00
|
|
|
|
2019-07-27 20:56:03 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-12-10 08:08:25 +00:00
|
|
|
rebuild 1
|
|
|
|
sha256 "40f8ae5dc1ace5e588ddfec9355e9a0377929ffa13b2480c1220aca2cd1ec718" => :catalina
|
|
|
|
sha256 "278e4cd358ae21365dc261a623f2dc976f0467ad56e352eadec9dac4de568fc9" => :mojave
|
|
|
|
sha256 "34dcd82075559df6a0a47081c7860cfc3450f58284ab0abff694f69d48df9f28" => :high_sierra
|
2019-07-27 20:56:03 +00:00
|
|
|
end
|
|
|
|
|
2019-07-26 19:24:18 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
2019-12-10 07:50:35 +00:00
|
|
|
system "go", "build", "-ldflags", "-s -w -X main.version=#{version}", "-trimpath", "-o", bin/"dive"
|
|
|
|
prefix.install_metafiles
|
2019-07-26 19:24:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"Dockerfile").write <<~EOS
|
|
|
|
FROM alpine
|
|
|
|
ENV test=homebrew-core
|
|
|
|
RUN echo "hello"
|
|
|
|
EOS
|
|
|
|
|
|
|
|
assert_match "dive #{version}", shell_output("#{bin}/dive version")
|
|
|
|
assert_match "Building image", shell_output("CI=true #{bin}/dive build .", 1)
|
|
|
|
end
|
|
|
|
end
|