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.

dev_vagrant.md 3.7 KiB

4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Bubble Vagrant Developer Setup
  2. ==============================
  3. [Vagrant](https://www.vagrantup.com/) is a popular way to run pre-packaged software on virtual machines
  4. like VirtualBox and VMware.
  5. Bubble uses Vagrant to create a development environment where you can work on the codebase, and build,
  6. run and test the API server and frontend webapp.
  7. # Requirements
  8. Before starting a Bubble Vagrant box, you'll need install some software if you don't already have it:
  9. * [VirtualBox](https://www.virtualbox.org/)
  10. * [Vagrant](https://www.vagrantup.com/)
  11. # Configuration
  12. There are a few environment variables you can use to configure how the Vagrant box is initialized.
  13. ## Port Selection
  14. Do you have anything already listening on port 8090? If so, set the `BUBBLE_PORT` environment
  15. variable to some free port where the Bubble API can listen. Otherwise, it defaults to 8090.
  16. ## Local Launcher and SSL Certificates
  17. Do you want to use this setup as a local launcher to start new Bubbles? If so, set
  18. the `LETSENCRYPT_EMAIL` environment variable to an email address that will be registered with
  19. [LetsEncrypt](https://letsencrypt.org/) when your Bubbles need to install SSL certificates.
  20. ## Other Settings
  21. Read the Bubble [Vagrantfile](../Vagrantfile) for full information on all settings.
  22. # Starting
  23. To start the Bubble Vagrant box, run:
  24. ```shell script
  25. vagrant up
  26. ```
  27. To start the Bubble Vagrant box with some environment variables (for example):
  28. ```shell script
  29. LETSENCRYPT_EMAIL=someone@example.com BUBBLE_PORT=8080 vagrant up
  30. ```
  31. The first time `vagrant up` runs it will take a long time to complete, since it needs to
  32. download and build a lot of stuff. Depending on the speed of your computer and internet,
  33. it could take anywhere from 5 to 20 or more minutes.
  34. For future runs of `vagrant up`, startup times will be much faster.
  35. When the command completes, you'll have a Vagrant box with the Bubble source code and all
  36. dependencies fully built and ready to run a local launcher.
  37. # Stopping
  38. To stop the Vagrant box, run:
  39. ```shell script
  40. vagrant halt
  41. ```
  42. # Deleting
  43. To delete the Vagrant box, run:
  44. ```shell script
  45. vagrant destroy [-f]
  46. ```
  47. If you supply `-f` then you will not be asked for confirmation.
  48. # Logging In
  49. When your Vagrant box is ready, you can login to it:
  50. ```shell script
  51. vagrant ssh
  52. ```
  53. ## Developing
  54. You can develop directly on the Vagrant box by editing the source files in `${HOME}/bubble`, then
  55. building and running from there.
  56. Alternatively, you can develop locally on the host and periodically synchronize your source
  57. and/or build assets to the Vagrant box, where you then (maybe build and) run the Bubble API.
  58. The `/vagrant` directory on the Vagrant guest box is a shared folder. On the host side, it
  59. is the directory that the `Vagrantfile` is in (the top-level of the bubble repository).
  60. For various reasons, the Vagrant box does not build and work in this directory directly. Instead,
  61. when the box is created, `/vagrant` is copied to `${HOME}/bubble` and we run things from there.
  62. So, if you are doing development and building locally (on the host), and want to see
  63. your changes on the Vagrant box (guest), then copy your bubble jar from the host to the guest:
  64. ```shell script
  65. cp /vagrant/bubble-server/target/bubble-server-*.jar ${HOME}/bubble/bubble-server/target/
  66. ```
  67. To synchronize the entire directory (for example if you're editing sources on
  68. the host and building the jar on the guest):
  69. ```shell script
  70. rsync -avzc /vagrant/* /vagrant/.* ${HOME}/bubble/
  71. ```
  72. ## What's Next
  73. Read [Bubble Developer Tasks](dev_tasks.md) to understand how to keep the code
  74. up to date, run the API server, rebuild the jar, and more.
  75. If you've started the Bubble API already using `run.sh`, and want to launch a Bubble,
  76. continue with [activation](activation.md).