The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

84 líneas
3.1 KiB

  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. # Build Bubble distribution ZIP file
  6. #
  7. # Usage:
  8. #
  9. # build_dist [no-build]
  10. #
  11. # no-build : if present, do not rebuild the bubble jar file
  12. #
  13. # Environment variables
  14. #
  15. # BUBBLE_ENV : env file to load. Default is ~/.bubble.env or /home/bubble/api/bubble.env (whichever is found first)
  16. #
  17. SCRIPT="${0}"
  18. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  19. . ${SCRIPT_DIR}/bubble_common
  20. NO_BUILD="${1}"
  21. BASE=$(cd $(dirname $0)/.. && pwd)
  22. cd ${BASE}
  23. if [[ -z "${NO_BUILD}" || "${NO_BUILD}" != "no-build" ]] ; then
  24. echo "Building bubble jar..."
  25. ${BASE}/bin/git_update_bubble.sh || die "Error building bubble jar file"
  26. else
  27. echo "Not building bubble jar: no-build was set"
  28. fi
  29. DIST_BASE="${BASE}/dist"
  30. rm -rf "${DIST_BASE}" || die "Error removing "${DIST_BASE}" directory"
  31. mkdir -p "${DIST_BASE}" || die "Error creating "${DIST_BASE}" directory"
  32. JAR_DIR="${BASE}/bubble-server/target"
  33. JAR="$(find "${JAR_DIR}" -type f -name "bubble-server-*.jar" | head -1)"
  34. if [[ -z "${JAR}" ]] ; then
  35. die "No bubble jar found in ${JAR_DIR}"
  36. fi
  37. VERSION_FILE="${BASE}/bubble-server/src/main/resources/META-INF/bubble/bubble.properties"
  38. VERSION=$(cat "${VERSION_FILE}" | grep bubble.version | awk -F '=' '{print $2}' | tr ' ' '_')
  39. if [[ -z "${VERSION}" ]] ; then
  40. die "No version found in ${VERSION_FILE}"
  41. fi
  42. DIST="${DIST_BASE}/bubble-${VERSION}"
  43. ZIP="${DIST_BASE}/bubble-${VERSION}.zip"
  44. mkdir -p "${DIST}" || die "Error creating distribution directory: ${DIST}"
  45. cp "${JAR}" "${DIST}/bubble.jar" || die "Error copying ${JAR} to ${DIST}/bubble.jar"
  46. cp "${BASE}/README.md" "${DIST}/README.md" || die "Error copying README.md to ${DIST}/README.md"
  47. cp "${BASE}/LICENSE.md" "${DIST}/LICENSE.md" || die "Error copying LICENSE.md to ${DIST}/LICENSE.md"
  48. cp -R "${BASE}/docs" "${DIST}" || die "Error copying docs directory to ${DIST}"
  49. cp -R "${BASE}/bin" "${DIST}" || die "Error copying bin 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}"
  54. if [[ ! -z "${BUBBLE_DIST_HOME}" ]] ; then
  55. IS_DEV=0
  56. if [[ -z ${BUILD_NUMBER} ]] ; then
  57. BUILD_NUMBER="dev"
  58. IS_DEV=1
  59. fi
  60. BUBBLE_VERSION="${VERSION}.${BUILD_NUMBER}"
  61. BUBBLE_DIST_TOP=${BUBBLE_DIST_HOME}/releases/bubble
  62. BUBBLE_DIST=${BUBBLE_DIST_TOP}/${BUBBLE_VERSION}/$(basename ${ZIP})
  63. BUBBLE_DIST_DIR="$(dirname ${BUBBLE_DIST})"
  64. if [[ ! -d "${BUBBLE_DIST_DIR}" ]] ; then
  65. mkdir -p ${BUBBLE_DIST_DIR}
  66. fi
  67. cp "${ZIP}" "${BUBBLE_DIST}" && cat "${ZIP}" | sha256sum | cut -f1 -d' ' | tr -d '\n' > "${BUBBLE_DIST}.sha256"
  68. if [[ ${IS_DEV} -eq 0 ]] ; then
  69. cd ${BUBBLE_DIST_TOP} && rm -f latest && ln -sf ${BUBBLE_VERSION} latest
  70. echo "${BUBBLE_VERSION}" > latest.txt
  71. cd ${BUBBLE_DIST_DIR} && ln -s "$(basename ${BUBBLE_DIST})" bubble.zip && ln -s "$(basename ${BUBBLE_DIST}).sha256" bubble.zip.sha256
  72. fi
  73. echo "Published release: ${BUBBLE_DIST}"
  74. fi