-
-
Notifications
You must be signed in to change notification settings - Fork 196
Testing install scripts
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](https://private-user-images.githubusercontent.com/5426/287307328-baa22c81-9616-495e-8c26-57aaaba6bf68.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzUwOTEsIm5iZiI6MTczODkzNDc5MSwicGF0aCI6Ii81NDI2LzI4NzMwNzMyOC1iYWEyMmM4MS05NjE2LTQ5NWUtOGMyNi01N2FhYWJhNmJmNjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTMyNjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjIyNDUwOGZmNzZhOWI2ZmFlZGZjZDgwZDA4ZDNjODczMTNmYjg3YzM3NjUzNjI4NmQzMjMxZjMzZmJmNTIxNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.teFdB_iriyNxOeQgg0dtpwQxHekntR8vaGt50M1jvtA)
![image](https://private-user-images.githubusercontent.com/5426/287274356-1295eabf-84c6-4d5b-bcdb-d5fe890d39d7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzUwOTEsIm5iZiI6MTczODkzNDc5MSwicGF0aCI6Ii81NDI2LzI4NzI3NDM1Ni0xMjk1ZWFiZi04NGM2LTRkNWItYmNkYi1kNWZlODkwZDM5ZDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTMyNjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2VlMGJlY2I2MTE4MDA1MjMwZDU4OWQ0OTRmNjQ1NmVkOTJjNzA2MTI2OTFhOTRiZDQ2ODcyNTdmZWY4OGE5ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.9Wdxtuucyl__O5r7YacPo1oswewfV4QPqxLsUcvU6Ac)
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
Install Alaveteli.
$ sudo sh ~/install-site.sh alaveteli alaveteli alaveteli.orb.local
Wait until "Installation complete" message, then start puma
.
$ sudo systemctl start alaveteli.puma
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
.
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.