|
- #!/bin/bash
- #
- # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
- #
- # Build the bubble jar
- #
- # Usage:
- #
- # bbuild [no-clean] [debug|full|prod]
- #
- # no-clean : if present, do not clean the `target` directory before building
- #
- # debug : a debug build, does not include anything else in the jar
- # full : a production build, creates a fat jar in `bubble-server/target/bubble-server-VERSION-full.jar`
- # prod : a production build, creates a slimmer jar in `bubble-server/target/bubble-server-VERSION-prod.jar`
- #
- # If debug/full/prod is not specified, the default is prod.
- #
- SCRIPT="${0}"
- SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
- . "${SCRIPT_DIR}"/bubble_common
-
- CLEAN="clean"
- PROFILE=""
- WEB=1
- if [[ -n "${1}" ]] ; then
- if [[ "${1}" == "no-clean" ]] ; then
- CLEAN=""
- shift
- fi
- if [[ "${1}" == "debug" ]] ; then
- PROFILE=""
- WEB=""
- elif [[ "${1}" == "full" ]] ; then
- PROFILE="-Pproduction-full"
- elif [[ "${1}" == "prod" ]] ; then
- PROFILE="-Pproduction"
- else
- die "Invalid argument: ${1}"
- fi
- else
- # default
- PROFILE="-Pproduction"
- fi
-
- BUBBLE_PRODUCTION=${WEB} mvn -DskipTests=true -Dcheckstyle.skip=true ${PROFILE} ${CLEAN} package
|