Newer
Older
MB_EDITION=${MB_EDITION:=oss}
if [ "$MB_EDITION" != ee ] && [ "$MB_EDITION" != oss ]; then
echo "MB_EDITION must be either 'ee' or 'oss'."
exit 1
fi
# Generate the resources/version.properties file
version() {
VERSION_INFO=$(./bin/version)
# Ok, now generate the appropriate version.properties file.
echo "tag=${info[0]}" > resources/version.properties
echo "hash=${info[1]}" >> resources/version.properties
echo "branch=${info[2]}" >> resources/version.properties
echo "date=${info[3]}" >> resources/version.properties
frontend-deps() {
echo "Running 'yarn' to download javascript dependencies..." &&
yarn
echo "Running 'webpack' with NODE_ENV=production assemble and minify frontend assets..." &&
NODE_ENV=production ./node_modules/.bin/webpack --bail
echo "Running 'webpack' with NODE_ENV=development to assemble frontend assets..." &&
NODE_ENV=development ./node_modules/.bin/webpack --bail --devtool eval
echo "Running './bin/i18n/build-translation-resources' to build translation resources..."
if ! ./bin/i18n/build-translation-resources; then
echo "Building translation resources failed, please install 'gettext', or build without translations by running './bin/build no-translations'."
exit 1
fi
}
drivers() {
echo "Building Metabase drivers..."
./bin/build-drivers.sh
echo "Running 'lein with-profile +$MB_EDITION uberjar'..."
lein with-profile +$MB_EDITION uberjar
Daniel Higginbotham
committed
version && translations && frontend && drivers && uberjar
Daniel Higginbotham
committed
version && frontend && drivers && uberjar
# Default to running all but let someone specify one or more sub-tasks to run instead if desired
# e.g.
# ./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
done
else
all
fi