The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

121 Zeilen
4.2 KiB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. # ==================
  6. # Bubble Vagrantfile
  7. # ==================
  8. # Running `vagrant up` will create a full Bubble development environment including all
  9. # dependencies, and build all the code and website. You'll be ready to run a local
  10. # launcher or do dev work on the Bubble codebase.
  11. #
  12. # After a box is launched, use `vagrant ssh` to log in.
  13. # - the code is in ${HOME}/bubble
  14. # - API environment file is ${HOME}/.bubble.env
  15. # - start the API server (local launcher) with run.sh
  16. # - access the webapp at http://127.0.0.1:${BUBBLE_PORT}/
  17. #
  18. # There are a few environment variables that determine how the box is initialized,
  19. # described below.
  20. #
  21. # ## Environment Variables
  22. #
  23. # ### LETSENCRYPT_EMAIL
  24. # If you specify the LETSENCRYPT_EMAIL environment variable, then `vagrant up` will also
  25. # start a Local Launcher (see docs/local-launcher.md) which is your starting point for
  26. # launching new Bubbles. You can always change this later by editing the `~/.bubble.env`
  27. # file after the Vagrant box is setup.
  28. #
  29. # ### BUBBLE_PORT
  30. # By default, Bubble will listen on port 8090.
  31. # If something else is already using that port on your computer, `vagrant up` will fail.
  32. # Set the `BUBBLE_PORT` environment variable to another port, and Bubble will listen on
  33. # that port instead.
  34. #
  35. # ### BUBBLE_VM_MEM
  36. # This is the number of MB of memory to allocate for the VirtualBox VM.
  37. # By default, this is set to 2048, thus Vagrantfile allocates 2GB of memory for the VM.
  38. # You can build and run Bubble with less memory, but if you go as low as 1024 (1GB) you
  39. # may have problems building the entire codebase from scratch.
  40. #
  41. Vagrant.configure("2") do |config|
  42. # Start with Ubuntu 20.04
  43. config.vm.box = "ubuntu/focal64"
  44. # Set name and memory
  45. mem = ENV['BUBBLE_VM_MEM'] || 2048
  46. config.vm.provider "virtualbox" do |v|
  47. v.name = 'Bubble_Vagrant'
  48. v.memory = mem
  49. end
  50. # Forward ports
  51. port = ENV['BUBBLE_PORT'] || 8090
  52. config.vm.network "forwarded_port", guest: port, host: port
  53. # Update system
  54. config.vm.provision :shell do |s|
  55. s.inline = <<-SHELL
  56. apt-get update -y
  57. apt-get upgrade -y
  58. SHELL
  59. end
  60. # Get dependencies and build everything
  61. config.vm.provision :shell do |s|
  62. s.env = { BUBBLE_PORT: port, LETSENCRYPT_EMAIL: ENV['LETSENCRYPT_EMAIL'] }
  63. s.privileged = false
  64. s.inline = <<-SHELL
  65. # Copy shared bubble dir to ${HOME}
  66. cd ${HOME} && rsync -azc --exclude="**/target/**" /vagrant . && mv vagrant bubble
  67. # Initialize the system
  68. cd ${HOME}/bubble && ./bin/first_time_ubuntu.sh
  69. # Clone submodules, build all dependencies, build the Bubble jar
  70. ./bin/first_time_setup.sh
  71. # Write bubble API port
  72. echo \"export BUBBLE_SERVER_PORT=${BUBBLE_PORT}\" > ~/.bubble.env
  73. # Allow web to be loaded from disk
  74. echo \"export BUBBLE_ASSETS_DIR=$(pwd)/bubble-web/dist\" >> ~/.bubble.env
  75. # Add bubble bin to PATH
  76. echo \"export PATH=\${PATH}:${HOME}/bubble/bin\" >> ~/.bashrc
  77. # Ensure Bubble API listens on all addresses
  78. echo \"export BUBBLE_LISTEN_ALL=true\" >> ~/.bashrc
  79. # Set LETSENCRYPT_EMAIL if defined
  80. if [[ -n \"${LETSENCRYPT_EMAIL}\" ]] ; then
  81. echo \"export LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}\" >> ~/.bubble.env
  82. fi
  83. # Create env file symlink for running tests
  84. cd ~ && ln -s .bubble.env .bubble-test.env
  85. # Done!
  86. echo "
  87. ==================================================================
  88. Bubble Vagrant Setup Complete
  89. ==================================================================
  90. Log in to this box using:
  91. vagrant ssh
  92. Once you are logged in:
  93. - the code is in ${HOME}/bubble
  94. - API environment file is ${HOME}/.bubble.env
  95. - start the API server (local launcher) with run.sh
  96. - access the webapp at http://127.0.0.1:${BUBBLE_PORT}/
  97. Enjoy!
  98. ==================================================================
  99. "
  100. SHELL
  101. end
  102. end