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.
 
 
 
 

107 líneas
3.6 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. #
  17. # There are a few environment variables that determine how the box is initialized,
  18. # described below.
  19. #
  20. # ## Environment Variables
  21. #
  22. # ### LETSENCRYPT_EMAIL
  23. # If you specify the LETSENCRYPT_EMAIL environment variable, then `vagrant up` will also
  24. # start a Local Launcher (see docs/local-launcher.md) which is your starting point for
  25. # launching new Bubbles. You can always change this later by editing the `~/.bubble.env`
  26. # file after the Vagrant box is setup.
  27. #
  28. # ### BUBBLE_PORT
  29. # By default, Bubble will listen on port 8090.
  30. # If something else is already using that port on your computer, `vagrant up` will fail.
  31. # Set the `BUBBLE_PORT` environment variable to another port, and Bubble will listen on
  32. # that port instead.
  33. #
  34. Vagrant.configure("2") do |config|
  35. config.vm.box = "ubuntu/focal64"
  36. # Forward ports
  37. port = ENV['BUBBLE_PORT'] || 8090
  38. config.vm.network "forwarded_port", guest: port, host: port
  39. # Update system
  40. config.vm.provision :shell do |s|
  41. s.inline = <<-SHELL
  42. apt-get update -y
  43. apt-get upgrade -y
  44. SHELL
  45. end
  46. # Get dependencies and build everything
  47. config.vm.provision :shell do |s|
  48. s.env = {
  49. BUBBLE_PORT: port,
  50. LETSENCRYPT_EMAIL: ENV['LETSENCRYPT_EMAIL']
  51. }
  52. s.privileged = false
  53. s.inline = <<-SHELL
  54. # Copy shared bubble dir to ${HOME}
  55. cd ${HOME} && rsync -azc --exclude="**/target/**" /vagrant . && mv vagrant bubble
  56. # Initialize the system
  57. cd ${HOME}/bubble && ./bin/first_time_ubuntu.sh
  58. # Clone and build all dependencies
  59. SKIP_BUBBLE_BUILD=1 ./bin/first_time_setup.sh
  60. # Build the bubble jar
  61. BUBBLE_PRODUCTION=1 mvn -DskipTests=true -Dcheckstyle.skip=true -Pproduction clean package 2>&1 | tee /tmp/build.log
  62. # Write bubble API port
  63. echo \"export BUBBLE_SERVER_PORT=${BUBBLE_PORT}\" > ~/.bubble.env
  64. # Allow website to be loaded from disk
  65. echo \"export BUBBLE_ASSETS_DIR=$(pwd)/bubble-web/dist\" >> ~/.bubble.env
  66. # Add bubble bin to PATH
  67. echo \"export PATH=\${PATH}:${HOME}/bubble/bin\" >> ~/.bashrc
  68. # Set LETSENCRYPT_EMAIL is defined
  69. if [[ -n \"${LETSENCRYPT_EMAIL}\" ]] ; then
  70. echo \"export LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}\" >> ~/.bubble.env
  71. fi
  72. # Create env file symlink for running tests
  73. cd ~ && ln -s .bubble.env .bubble-test.env
  74. # Done!
  75. echo "
  76. ==================================================================
  77. Bubble Vagrant Setup Complete
  78. ==================================================================
  79. Log in to this box using:
  80. vagrant ssh
  81. Once logged in:
  82. - the code is in ${HOME}/bubble
  83. - API environment file is ${HOME}/.bubble.env
  84. - start the API server (local launcher) with run.sh
  85. Enjoy!
  86. ==================================================================
  87. "
  88. SHELL
  89. end
  90. end