| 1 |
# -*- mode: ruby -*- |
| 2 |
# vi: set ft=ruby : |
| 3 |
# SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 |
|
| 5 |
require 'etc' |
| 6 |
|
| 7 |
Vagrant.configure(2) do |config| |
| 8 |
config.vm.box = "freedombox/freedombox-testing-dev" |
| 9 |
config.vm.network "public_network" |
| 10 |
config.vm.synced_folder ".", "/freedombox", owner: "plinth", group: "plinth" |
| 11 |
config.vm.provider "virtualbox" do |vb| |
| 12 |
vb.cpus = Etc.nprocessors |
| 13 |
vb.memory = 2048 |
| 14 |
vb.linked_clone = true |
| 15 |
vb.customize ["modifyvm", :id, "--firmware", "efi"] |
| 16 |
end |
| 17 |
config.vm.provision "shell", run: 'always', inline: <<-SHELL |
| 18 |
# Disable automatic upgrades |
| 19 |
echo -e 'APT::Periodic::Update-Package-Lists "0";\nAPT::Periodic::Unattended-Upgrade "0";' > //etc/apt/apt.conf.d/20auto-upgrades |
| 20 |
# Do not run system plinth |
| 21 |
systemctl stop plinth |
| 22 |
systemctl disable plinth |
| 23 |
SHELL |
| 24 |
config.vm.provision "shell", inline: <<-SHELL |
| 25 |
cd /freedombox/ |
| 26 |
make provision-dev |
| 27 |
SHELL |
| 28 |
config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh" |
| 29 |
config.vm.post_up_message = "FreedomBox virtual machine is ready |
| 30 |
for development. To get the IP address: |
| 31 |
$ vagrant ssh |
| 32 |
$ ip address show |
| 33 |
|
| 34 |
FreedomBox interface will be available at https://<ip address>/freedombox |
| 35 |
(with an invalid SSL certificate). To watch logs: |
| 36 |
$ vagrant ssh |
| 37 |
$ sudo freedombox-logs |
| 38 |
" |
| 39 |
|
| 40 |
config.vm.boot_timeout=1200 |
| 41 |
end |