Skip to content

Testing install scripts

Graeme Porteous edited this page Dec 1, 2023 · 6 revisions

Setup VM

To test Alaveteli install scripts on my Apple Silicon mac without Vagrant I have been using OrbStack.

From the OrbStack dashboard, you can create a new Debian machine, you can then right click on the VM and "Open Terminal"

image image

Production install

This will open a shell in the virtual machine. Install rsyslog and get the install script.

gbp@alaveteli:~$ sudo apt-get install -y rsyslog
gbp@alaveteli:~$ curl -O https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh ~/

Install Alaveteli.

gbp@alaveteli:~$ sudo sh ~/install-site.sh alaveteli alaveteli alaveteli.orb.local

Wait until "Installation complete" message, then start thin:

gbp@alaveteli:~$ sudo systemctl start alaveteli-thin

In your browser go to http://alaveteli.orb.local/ - NB: no SSL by default.

You can become the alaveteli user with sudo -iu alaveteli and cd /var/www/alaveteli.orb.local/alaveteli to run Rails commands.

Development install

OrbStack supports two-way file sharing so all your files on your Mac are available from the VM. So you can cd into your local Alaveteli directory where a non master or WIP branch might be checked out.

Due to how the install script works you actually should cd in to the parent directory, EG: Use /Users/gbp/Developer/work, not /Users/gbp/Developer/work/alaveteli.

From there you can run the install script with the dev flag.

sudo sh ~/install-site.sh --dev alaveteli alaveteli alaveteli.orb.local

You can become the alaveteli user with sudo -iu alaveteli and cd to use Alaveteli directory, say /Users/gbp/Developer/work/alaveteli this time (not the parent directory) and start the development server with RAILS_DEVELOPMENT_HOSTS=alaveteli.orb.local bin/rails s -b 0.0.0.0

In your browser go to http://alaveteli.orb.local:3000/ - NB: no SSL by default.

Clone this wiki locally