ajermakovics / jvm-mon

Console-based JVM monitoring tool
https://ajermakovics.github.io/jvm-mon/
Other
1.48k stars 117 forks source link

Make available through homebrew #5

Closed johanhaleby closed 7 years ago

johanhaleby commented 7 years ago

Would be great if it would be possible to distribute it using homebrew

ajermakovics commented 7 years ago

Great idea! Have never published on homebrew before so not sure how easy it is

johanhaleby commented 7 years ago

I've tried to publish a project once, kubetail but it was declined :). You should probably open up a tap (which is what I'll try to do next). Maybe you can find some inspiration from the wiki page I wrote, if not then I suppose one has to read the docs :/

ctwise commented 7 years ago

It's easy to publish on homebrew, the "recipes" are simple scripts. But... the app needs to be self-contained. You can't have scripts that have to be called from certain directories, npm installs that need to be run, etc.

ajermakovics commented 7 years ago

The 'self-contained' bit might be tricky. jvm-mon relies on a jdk being on the machine.

janhoy commented 7 years ago

I tried it out locally, and this simple formula works: https://gist.github.com/03eea1303e5a9ff1a85dfffd96d4a674 (Download and copy to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jvm-mon.rb)

This is the file layout after install

/usr/local/Cellar$ tree -L 3 jvm-mon/
jvm-mon/
└── 0.2
    ├── INSTALL_RECEIPT.json
    ├── bin
    │   └── jvm-mon -> ../libexec/bin/jvm-mon
    └── libexec
        ├── bin
        ├── jvm-mon.js
        ├── lib
        └── node_modules
janhoy commented 7 years ago

As you see, we specify java 8 as a dependency, and the node deps do not install any moving parts, so should be safe. Anyway, it works :)

ajermakovics commented 7 years ago

Submitted PR https://github.com/Homebrew/homebrew-core/pull/11661 Unfortunately automatic checks failed but not quite sure why. Works locally

ajermakovics commented 7 years ago

Ok, the formula needs a test

ajermakovics commented 7 years ago

It's been merged into homebrew! Thank you @janhoy!

brew install jvm-mon