The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

71 linhas
2.2 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. # Perform one-time setup of a new Mac OS X system.
  6. #
  7. # NOTE: you must manually install AdoptOpenJDK 11 from https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot
  8. #
  9. # It is safe to run this multiple times, it is idempotent.
  10. #
  11. function die {
  12. echo 1>&2 "${1}"
  13. exit 1
  14. }
  15. function db_user_exists {
  16. username="${1}"
  17. num_users="$(echo "select count(*) from pg_user where usename='${username}'" | psql -qt | egrep -v '^$')"
  18. if [[ -z "${num_users}" || ${num_users} -eq 0 ]] ; then
  19. echo "0"
  20. else
  21. echo "1"
  22. fi
  23. }
  24. # Install packer
  25. BUBBLE_BIN="$(cd "$(dirname "${0}")" && pwd)"
  26. "${BUBBLE_BIN}/install_packer.sh" || die "Error installing packer"
  27. if [[ -z "$(which brew)" ]] ; then
  28. # Install homebrew
  29. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  30. fi
  31. # Install emacs
  32. brew cask install emacs
  33. # Install AdoptOpenJDK 11
  34. echo ">>> Please install AdoptOpenJDK 11 from https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot"
  35. # Install IntelliJ IDEA
  36. echo "Consider installing IntelliJ IDEA from https://www.jetbrains.com/idea/download/#section=mac"
  37. # Install packages
  38. brew install maven
  39. brew install postgresql@10 && brew services start postgresql@10
  40. brew install redis && brew services start redis
  41. brew install jq
  42. brew install python@3.8
  43. brew install npm
  44. brew install webpack
  45. sudo pip3 install setuptools psycopg2-binary
  46. # Add python paths to script rc
  47. export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
  48. export PATH="/usr/local/opt/python@3.8/bin:$PATH"
  49. # Create DB user 'postgres' as super admin
  50. if [[ $(db_user_exists 'postgres') == "1" ]] ; then
  51. echo "PostgreSQL user ${CURRENT_USER} already exists, not creating"
  52. else
  53. createuser --createdb --superuser --createrole postgres || die "Error creating postgres DB user"
  54. fi
  55. # Create DB user 'bubble', with the ability to create databases
  56. if [[ $(db_user_exists 'bubble') == "1" ]] ; then
  57. echo "PostgreSQL user bubble already exists, not creating"
  58. else
  59. createuser --createdb bubble || die "Error creating bubble DB user"
  60. fi