From e2f4cf288d26b8a08e3877806b977633ce3224d9 Mon Sep 17 00:00:00 2001 From: dacort Date: Wed, 9 Oct 2019 10:49:26 -0700 Subject: [PATCH] Update the README with some better instructions and...BADGES. --- README.md | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 631aef7..83186ad 100644 --- a/README.md +++ b/README.md @@ -2,46 +2,60 @@ 💥*Note:* This project is under active development -## Build +[![Latest Release](https://img.shields.io/github/v/release/dacort/metabase-athena-driver.svg?label=latest%20release&include_prereleases)](https://github.com/dacort/metabase-athena-driver/releases) +[![GitHub license](https://img.shields.io/github/license/dacort/metabase-athena-driver)](https://raw.githubusercontent.com/dacort/metabase-athena-driver/master/LICENSE) + +## Installation + +Beginning with Metabase 0.32, drivers must be stored in a `plugins` directory in the same directory where `metabase.jar` is, or you can specify the directory by setting the environment variable `MB_PLUGINS_DIR`. + +### Download Metabase Jar and Run + +1. Download a fairly recent Metabase binary release (jar file) from the [Metabase distribution page](https://metabase.com/start/jar.html). +2. Download the Athena driver jar from this repository's "Releases" page +3. Create a directory and copy the `metabase.jar` to it. +4. In that directory create a sub-directory called `plugins`. +5. Copy the Athena driver jar to the `plugins` directory. +6. Make sure you are the in the directory where your `metabase.jar` lives. +7. Run `java -jar metabase.jar`. + +### Build from source I'm not familiar enough with `lein` to know if there is a better way to include a jar from a static URL, so for the time being we download it manually. -1. Download the Athena driver into your local Maven repo +1. Download a fairly recent Metabase binary release (jar file) from the [Metabase distribution page](https://metabase.com/start/jar.html). + +2. Download the Athena driver into your local Maven repo ```shell mkdir -p ~/.m2/repository/athena/athena-jdbc/2.0.7/ wget -O ~/.m2/repository/athena/athena-jdbc/2.0.7/athena-jdbc-2.0.7.jar https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.7/AthenaJDBC42_2.0.7.jar ``` -2. Clone this repo +3. Clone this repo ```shell git clone https://github.com/dacort/metabase-athena-driver ``` -3. Build the jar +4. Build the jar ```shell cd metabase-athena-driver/ DEBUG=1 LEIN_SNAPSHOTS_IN_RELEASE=true lein uberjar ``` -## Running - -Beginning with Metabase 0.32, drivers must be stored in a `plugins` directory in the same directory where `metabase.jar` is, or you can specify the directory by setting the env var `MB_PLUGINS_DIR`. - -Let's assume we download `metabase.jar` to `~/metabae/` and we built the project above. From the source directory: - -```shell -TARGET_DIR=~/metabae -mkdir ${TARGET_DIR}/plugins/ -cp target/uberjar/athena.metabase-driver.jar ${TARGET_DIR}/plugins/ -cd ${TARGET_DIR}/ -java -jar metabase.jar -``` +5. Let's assume we download `metabase.jar` to `~/metabae/` and we built the project above. Copy the built jar to the Metabase plugins directly and run Metabase from there! + ```shell + TARGET_DIR=~/metabae + mkdir ${TARGET_DIR}/plugins/ + cp target/uberjar/athena.metabase-driver.jar ${TARGET_DIR}/plugins/ + cd ${TARGET_DIR}/ + java -jar metabase.jar + ``` You should see a message on startup similar to: ``` -05-07 23:27:32 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :athena... -05-07 23:27:32 INFO metabase.driver :: Registered driver :athena (parents: #{:sql-jdbc}) 🚚 +2019-05-07 23:27:32 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :athena... +2019-05-07 23:27:32 INFO metabase.driver :: Registered driver :athena (parents: #{:sql-jdbc}) 🚚 ``` ## Configuring