Skip to content

Commit

Permalink
Move build-uberjar to bin/build, remove redundant install commands from
Browse files Browse the repository at this point in the history
package.json, and add bin/start
  • Loading branch information
tlrobinson committed Oct 8, 2015
1 parent 3a3064a commit fd6d628
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: sh -c "MB_JETTY_PORT=${PORT} MB_DB_CONNECTION_URI=${DATABASE_URL} java -jar ./target/uberjar/metabase-standalone.jar"
web: ./bin/start
6 changes: 3 additions & 3 deletions build-uberjar → bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ all() {

# Default to running all but let someone specify one or more sub-tasks to run instead if desired
# e.g.
# ./build-uberjar # do everything
# ./build-uberjar version # just update version.properties
# ./build-uberjar version uberjar # just update version.properties and build uberjar
# ./bin/build # do everything
# ./bin/build version # just update version.properties
# ./bin/build version uberjar # just update version.properties and build uberjar
if [ "$1" ]; then
for cmd in "$@"; do
$cmd
Expand Down
16 changes: 16 additions & 0 deletions bin/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

[ "$PORT" ] && export MB_JETTY_PORT="$PORT"

# Translate various Heroku environment variables to Metabase equivalents

[ "$DATABASE_URL" ] && export MB_DB_CONNECTION_URI="$DATABASE_URL"

if [ "$MAILGUN_SMTP_LOGIN" ]; then
export MB_EMAIL_SMTP_HOST="$MAILGUN_SMTP_PASSWORD"
export MB_EMAIL_SMTP_PORT="$MAILGUN_SMTP_PORT"
export MB_EMAIL_SMTP_USERNAME="$MAILGUN_SMTP_LOGIN"
export MB_EMAIL_SMTP_PASSWORD="$MAILGUN_SMTP_PASSWORD"
fi

exec java $JAVA_OPTS -jar ./target/uberjar/metabase-standalone.jar
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test:
# 2) runs Eastwood linter
# 3) Bikeshed linter
# 4) runs JS linter + JS test
# 5) runs lein uberjar. (We don't run build-uberjar because we're not really concerned about `npm install` (etc) in this test, which runs elsewhere)
# 5) runs lein uberjar. (We don't run bin/build because we're not really concerned about `npm install` (etc) in this test, which runs elsewhere)
- case $CIRCLE_NODE_INDEX in 0) MB_TEST_DATASETS=h2,mongo,postgres lein test ;; 1) MB_TEST_DATASETS=h2,mysql MB_DB_TYPE=postgres MB_DB_DBNAME=circle_test MB_DB_PORT=5432 MB_DB_USER=ubuntu MB_DB_HOST=localhost lein test ;; 2) lein eastwood ;; 3) lein bikeshed --max-line-length 240 ;; 4) npm install && npm run lint && npm run build && npm run test ;; 5) lein uberjar ;; esac:
parallel: true
deployment:
Expand Down
2 changes: 1 addition & 1 deletion deploy/functions
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build_uberjar() {
$(which locale) | $(which sort) || true

echo "building uberjar"
${PROJECT_ROOT}/build-uberjar
${PROJECT_ROOT}/bin/build
}

upload_release_artifacts() {
Expand Down
2 changes: 1 addition & 1 deletion docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ These are the set of tools which are required in order to complete any build of

The entire Metabase application is compiled and assembled into a single .jar file which can run on any modern JVM. There is a script which will execute all steps in the process and output the final artifact for you.

./build-uberjar
./bin/build

After running the build script simply look in `target/uberjar` for the output .jar file and you are ready to go.

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@
"build": "./node_modules/webpack/bin/webpack.js",
"build-watch": "./node_modules/webpack/bin/webpack.js --watch",
"build-hot": "NODE_ENV=hot ./node_modules/webpack/bin/webpack.js && NODE_ENV=hot node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot --inline --content-base frontend",
"start": "npm run build && lein ring server",
"preinstall": "./build-uberjar version",
"postinstall": "npm run build"
"start": "npm run build && lein ring server"
}
}

0 comments on commit fd6d628

Please sign in to comment.