From 8007289e575e75409ebe0565af56adbf2f634256 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Mon, 13 Aug 2018 12:27:53 +0530 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- HACKING.md | 23 +++++++++++++---------- Vagrantfile | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/HACKING.md b/HACKING.md index ad393be82..55a636d2b 100644 --- a/HACKING.md +++ b/HACKING.md @@ -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 Vagrant, simply execute in your FreedomBox Service (Plinth) development folder: - ``` $ vagrant up ``` -3. To access FreedomBox web interface (from host), visit - 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: - +3. SSH into the running vagrant box with the following command: ``` - $ 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 Apart from dependencies listing in INSTALL.md file, there may be additional diff --git a/Vagrantfile b/Vagrantfile index 1260a1e31..0644b2282 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,12 +25,19 @@ Vagrant.configure(2) do |config| apt update DEBIAN_FRONTEND=noninteractive apt install -y $(plinth --list-dependencies) systemctl daemon-reload - systemctl restart plinth SHELL - config.vm.post_up_message = "FreedomBox machine is ready for development. -You can access it on https://localhost:4430/plinth/ (with an invalid -SSL certificate). You can modify source code on the host machine and -then test it by running: -$ vagrant provision + config.vm.provision "shell", run: 'always', inline: <<-SHELL + # Do not run system plinth + systemctl stop plinth + systemctl disable plinth + # 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