The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

4 роки тому
4 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. #
  6. # Build Bubble distribution ZIP file
  7. #
  8. # Usage:
  9. #
  10. # build_dist [no-build]
  11. #
  12. # no-build : if present, do not rebuild the bubble jar file
  13. #
  14. # Environment variables
  15. #
  16. # BUBBLE_ENV : env file to load. Default is ~/.bubble.env or /home/bubble/current/bubble.env (whichever is found first)
  17. #
  18. SCRIPT="${0}"
  19. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  20. . ${SCRIPT_DIR}/bubble_common
  21. NO_BUILD="${1}"
  22. BASE=$(cd $(dirname $0)/.. && pwd)
  23. cd ${BASE}
  24. if [[ -z "${NO_BUILD}" || "${NO_BUILD}" != "no-build" ]] ; then
  25. echo "Building bubble jar..."
  26. ${BASE}/bin/git_update_bubble.sh || die "Error building bubble jar file"
  27. else
  28. echo "Not building bubble jar: no-build was set"
  29. fi
  30. DIST_BASE="${BASE}/dist"
  31. rm -rf "${DIST_BASE}" || die "Error removing "${DIST_BASE}" directory"
  32. mkdir -p "${DIST_BASE}" || die "Error creating "${DIST_BASE}" directory"
  33. JAR_DIR="${BASE}/bubble-server/target"
  34. JAR="$(find "${JAR_DIR}" -type f -name "bubble-server-*.jar" | head -1)"
  35. if [[ -z "${JAR}" ]] ; then
  36. die "No bubble jar found in ${JAR_DIR}"
  37. fi
  38. VERSION_FILE="${BASE}/bubble-server/src/main/resources/META-INF/bubble/bubble.properties"
  39. VERSION=$(cat "${VERSION_FILE}" | grep bubble.version | awk -F '=' '{print $2}')
  40. if [[ -z "${VERSION}" ]] ; then
  41. die "No version found in ${VERSION_FILE}"
  42. fi
  43. DIST="${DIST_BASE}/bubble-${VERSION}"
  44. ZIP="${DIST_BASE}/bubble-${VERSION}.zip"
  45. mkdir -p "${DIST}" || die "Error creating distribution directory: ${DIST}"
  46. cp "${JAR}" "${DIST}/bubble.jar" || die "Error copying ${JAR} to ${DIST}/bubble.jar"
  47. cp "${BASE}/dist-README.md" "${DIST}/README.md" || die "Error copying dist-README.md to ${DIST}/README.md"
  48. cp -R "${BASE}/bin" "${DIST}" || die "Error copying bin directory to ${DIST}"
  49. cp -R "${BASE}/scripts" "${DIST}" || die "Error copying scripts directory to ${DIST}"
  50. cp -R "${BASE}/config" "${DIST}" || die "Error copying config directory to ${DIST}"
  51. cd "${DIST}/.." && zip -r "${ZIP}" "$(basename ${DIST})"
  52. echo "Distribution created: "
  53. ls -lh "${ZIP}"