vagrant: Vagrantfile changes for ease of development

Moved some frequently required operations to the Vagrantfile.

Newcomers to the project almost always face the issue of port 8000 not being
available. Disabling system Plinth and running only the development version
solves this issue.

Automatic upgrades are a frequent blocker for development and an unnecessary
annoyance on a development setup.

- Update documentation about vagrant file changes

- Remove plinth restart step

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2018-08-13 12:27:53 +05:30 committed by James Valleroy
parent 7cb7398349
commit 8007289e57
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 26 additions and 16 deletions

View File

@ -18,23 +18,26 @@ and requires about 4.5 GB of disk space.
2. To download, setup, run, and configure a VM for FreedomBox development using 2. To download, setup, run, and configure a VM for FreedomBox development using
Vagrant, simply execute in your FreedomBox Service (Plinth) development Vagrant, simply execute in your FreedomBox Service (Plinth) development
folder: folder:
``` ```
$ vagrant up $ vagrant up
``` ```
3. To access FreedomBox web interface (from host), visit 3. SSH into the running vagrant box with the following command:
https://localhost:4430/plinth/
4. Edit the source code in your host machine's FreedomBox Service (Plinth)
development folder. By default, this folder is shared within the VM, at
`/vagrant/`. To actually reflect the changes in the running VM, run on your
host:
``` ```
$ vagrant provision $ vagrant ssh
``` ```
4. Run the development version of Plinth from your source directory in the
virtual machine using the following command. This command continuously
deploys your code changes into the virtual machine providing a quick feedback
cycle during development.
```
$ sudo /vagrant/run --develop
```
Note: This virtual machine has automatic upgrades disabled by default.
## Installing Dependencies ## Installing Dependencies
Apart from dependencies listing in INSTALL.md file, there may be additional Apart from dependencies listing in INSTALL.md file, there may be additional

19
Vagrantfile vendored
View File

@ -25,12 +25,19 @@ Vagrant.configure(2) do |config|
apt update apt update
DEBIAN_FRONTEND=noninteractive apt install -y $(plinth --list-dependencies) DEBIAN_FRONTEND=noninteractive apt install -y $(plinth --list-dependencies)
systemctl daemon-reload systemctl daemon-reload
systemctl restart plinth
SHELL SHELL
config.vm.post_up_message = "FreedomBox machine is ready for development. config.vm.provision "shell", run: 'always', inline: <<-SHELL
You can access it on https://localhost:4430/plinth/ (with an invalid # Do not run system plinth
SSL certificate). You can modify source code on the host machine and systemctl stop plinth
then test it by running: systemctl disable plinth
$ vagrant provision # Disable automatic upgrades
/vagrant/actions/upgrades disable-auto
SHELL
config.vm.post_up_message = "FreedomBox virtual machine is ready
for development. You can run the development version of Plinth using
the following command.
$ sudo /vagrant/run --develop
Plinth will be available at https://localhost:4430/plinth (with
an invalid SSL certificate).
" "
end end