Skip to content

Testing install scripts

Graeme Porteous edited this page Dec 4, 2023 · 5 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

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

$ curl https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh -o ~/install-site.sh

Production install

Install Alaveteli.

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

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

$ 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 move into your Alaveteli directory.

cd /var/www/alaveteli.orb.local/alaveteli

From here you can run the standard Alaveteli Rails commands using bin/rails or bundle exec rails.

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.

$ cd /Users/gbp/Developer/work # not you alaveteli directory

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 move into your Alaveteli directory.

cd /Users/gbp/Developer/work/alaveteli # not the parent directory this time

And start the development server.

$ 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