-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New driver build scripts and fix Google driver build * Install Clojure CLI in Circle CI * Fix driver build script * Build script fix 🔧 * More dox * Enforce minimum build Clojure CLI version and address feedback * New metabuild-common directory for shared stuff. Address some PR feedback
- Loading branch information
Showing
27 changed files
with
982 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
*.xcworkspacedata | ||
.DS_Store | ||
.\#* | ||
.cpcache | ||
.cpcache/ | ||
.eastwood | ||
.idea/ | ||
.nrepl-port | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,9 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -eo pipefail | ||
set -euo pipefail | ||
|
||
# If ran as `./bin/build-drivers.sh clean` then uninstall metabase-core from the local Maven repo and delete | ||
if [ "$1" == clean ]; then | ||
echo "Deleting existing installed metabase-core and driver dependencies..." | ||
rm -rf ~/.m2/repository/metabase-core | ||
rm -rf ~/.m2/repository/metabase/*-driver | ||
source "./bin/check-clojure-cli.sh" | ||
check_clojure_cli | ||
|
||
echo "Deleting built drivers in resources/modules..." | ||
rm -rf resources/modules | ||
echo "Deleting build Metabase uberjar..." | ||
rm -rf target | ||
|
||
for target in `find modules -name 'target' -type d`; do | ||
echo "Deleting $target..." | ||
rm -rf "$target" | ||
done | ||
fi | ||
|
||
# strip trailing slashes if `ls` is set to include them | ||
drivers=`ls modules/drivers/ | sed 's|/$||'` | ||
|
||
for driver in $drivers; do | ||
echo "Build: $driver" | ||
|
||
build_failed='' | ||
./bin/build-driver.sh "$driver" || build_failed=true | ||
|
||
if [ "$build_failed" ]; then | ||
echo "Failed to build driver $driver." | ||
exit -1 | ||
fi | ||
done | ||
|
||
# Double-check that all drivers were built successfully | ||
for driver in $drivers; do | ||
verification_failed='' | ||
./bin/verify-driver "$driver" || verification_failed=true | ||
|
||
if [ "$verification_failed" ]; then | ||
exit -2 | ||
fi | ||
done | ||
cd bin/build-drivers | ||
clojure -M -m build-drivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Build-drivers scripts | ||
|
||
Scripts for building Metabase driver plugins. You must install the [Clojure CLI | ||
tools](https://www.clojure.org/guides/getting_started) to use these. | ||
|
||
There are three main entrypoints. Shell script wrappers are provided for convenience and compatibility. | ||
|
||
### `build-drivers` | ||
|
||
Builds *all* drivers as needed. If drivers were recently built and no relevant source code changed, skips rebuild. | ||
|
||
``` | ||
cd bin/build-drivers | ||
clojure -M -m build-drivers | ||
# or | ||
./bin/build-drivers.sh | ||
``` | ||
|
||
### `build-driver` | ||
|
||
Build a single driver as needed. Builds parent drivers if needed first. | ||
|
||
``` | ||
cd bin/build-driver redshift | ||
clojure -M -m build-driver redshift | ||
# or | ||
./bin/build-driver.sh redshift | ||
``` | ||
|
||
### `verify-driver` | ||
|
||
Verify that a built driver looks correctly built. | ||
|
||
``` | ||
cd bin/verify-driver redshift | ||
clojure -M -m verify-driver redshift | ||
# or | ||
./bin/verify-driver redshift | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(ns build-driver | ||
"Entrypoint for `bin/build-driver.sh`. Builds a single driver, if needed." | ||
(:require [build-drivers.build-driver :as build-driver] | ||
[metabuild-common.core :as u])) | ||
|
||
(defn -main [& [driver]] | ||
(u/exit-when-finished-nonzero-on-exception | ||
(when-not (seq driver) | ||
(throw (ex-info "Usage: clojure -m build-driver <driver>" {}))) | ||
(build-driver/build-driver! (keyword driver)))) |
Oops, something went wrong.