The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 line
1.4 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. # Create packer images for sage and/or node
  6. #
  7. # Usage:
  8. #
  9. # pack_bubble [node|sage] [cloud CloudName]
  10. #
  11. # node : only pack the node image, do not pack the sage
  12. # sage : only pack the sage image, do not pack the node
  13. # cloud CloudName : only pack for CloudName compute cloud, do not pack for all clouds
  14. #
  15. SCRIPT="${0}"
  16. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  17. . "${SCRIPT_DIR}"/bubble_common
  18. if [[ -z "${1}" ]] ; then
  19. IMAGES="node sage"
  20. elif [[ "${1}" == "node" ]] ; then
  21. IMAGES="node"
  22. shift
  23. elif [[ "${1}" == "sage" ]] ; then
  24. IMAGES="sage"
  25. shift
  26. fi
  27. if [[ -z "${1}" ]] ; then
  28. CLOUDS_URL="me/clouds?type=compute"
  29. CLOUDS="$("${SCRIPT_DIR}/bgetn" "${CLOUDS_URL}")"
  30. if [[ -z "${CLOUDS}" ]] ; then
  31. die "Error reading compute cloud names from ${CLOUDS_URL}"
  32. fi
  33. elif [[ "${1}" == "cloud" ]] ; then
  34. CLOUDS="${2}"
  35. if [[ -z "${CLOUDS}" ]] ; then
  36. die "No cloud name specified after -cloud"
  37. fi
  38. else
  39. die ""
  40. fi
  41. for cloud in ${CLOUDS} ; do
  42. for image in ${IMAGES} ; do
  43. echo "Building ${image} image for cloud ${cloud} ..."
  44. "${SCRIPT_DIR}/bpute" "me/clouds/${cloud}/packer/${image}" || die "Error submitting packer build: ${image} / ${cloud}"
  45. done
  46. done