-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (56 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copied almost entirely from https://github.com/elastic/homebrew-tap/blob/main/Formula/kibana-full.rb
# Release notes: https://www.elastic.co/guide/en/kibana/7.17/release-notes.17.14.html
class KibanaFullAT717 < Formula
desc "Analytics and search dashboard for Elasticsearch"
homepage "https://www.elastic.co/products/kibana"
url "https://artifacts.elastic.co/downloads/kibana/kibana-7.17.14-darwin-x86_64.tar.gz"
version "7.17.14"
sha256 "51373ff8ca04e16e4f0ed46258a24a2e934c9cdd0a071717533e66d3caa3b827"
keg_only :versioned_formula
def install
libexec.install(
"bin",
"config",
"data",
"node",
"node_modules",
"package.json",
"plugins",
"src",
"x-pack",
)
Pathname.glob(libexec/"bin/*") do |f|
next if f.directory?
bin.install libexec/"bin"/f
end
options = { "KIBANA_PATH_CONF" => etc/"kibana", "DATA_PATH" => var/"lib/kibana/data" }
bin.env_script_all_files(libexec/"bin", options)
cd libexec do
packaged_config = File.read "config/kibana.yml"
File.write "config/kibana.yml", "path.data: #{var}/lib/kibana/data\n" + packaged_config
(etc/"kibana").install Dir["config/*"]
rm_rf "config"
rm_rf "data"
end
end
def post_install
(var/"lib/kibana/data").mkpath
(prefix/"plugins").mkdir
end
def caveats
<<~EOS
Config: #{etc}/kibana/
If you wish to preserve your plugins upon upgrade, make a copy of
#{opt_prefix}/plugins before upgrading, and copy it into the
new keg location after upgrading.
EOS
end
service do
run opt_bin/"kibana"
keep_alive true
end
test do
ENV["BABEL_CACHE_PATH"] = testpath/".babelcache.json"
assert_match(/#{version}/, shell_output("#{bin}/kibana -V"))
end
end