-
Notifications
You must be signed in to change notification settings - Fork 6
Get started with Vagrant
All code for the AIS and other applications that we have in THS Armada can be found here on our Github. When we develop the AIS, the main testing environment is on your own computer. To have a local version of the AIS you want to run it within a virtual machine. This document contains information on how to set up your local AIS.
- Download and install Vagrant and VirtualBox.
- Activate Vt-x in BIOS
- Go to Control panel > Program and functions > Activate/Deactivate Windows functions:
• disable Hyper-V
• enable Windows Hypervisor Platform - Clone the AIS repo via SSH and cd into it (new to SSH? See how to generate a new SSH key and how to add it to your GitHub account)
git clone [email protected]:armada-ths/ais.git cd ais
- Navigate to the directory which contains the
provision.sh
file:cd scripts/vagrant
. - Replace the content of
provision.sh
with the content of this file. - Go back to the root directory:
cd ../..
and then runvagrant up
. This will create your virtual machine containing the AIS system. You can view your virtual machine in the Virtualbox GUI. Take a look at the Vagrantfile in the root andscripts/vagrant/provision.sh
to see what goes on. You might have to runvagrant up
as admin (and enable it to create new directories on your computer). Runningvagrant up
should create two directories under your user:.vagrant.d
and.VirtualBox
. - Enter your VirtualBox with
vagrant ssh
. - Now you are inside the virtual environment. Run
sed -i 's/\r//' *.sh
. This will stop windows from converting line endings to CRLF. Also, rungit config --global core.autocrlf true
. Default setting is that file endings will be converted to Windows CRLF and then it will appear as you have done A LOT of changes to your working directory compared to the master branch.
To make sure that git will always convert your CRLF line endings to LF when committing (and the other way around when in the opposite direction) it is recommended to have this setting if you are on a Windows computer. You can read here and here.
9. Start the server with ./dev-runserver.sh
. Browse to localhost:8080 to see your local version of the AIS!
- Download and install:
• Vagrant• VirtualBoxcurl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" sudo apt-get update && sudo apt-get install vagrant
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - sudo apt-get update && sudo apt-get install virtualbox-6.1
- Clone the AIS repo via SSH and cd into it (new to SSH? See how to generate a new SSH key and how to add it to your GitHub account)
git clone [email protected]:armada-ths/ais.git cd ais
- Run
vagrant up
. This will create your virtual machine containing the AIS system. You can view your virtual machine in the Virtualbox GUI. Take a look at the Vagrantfile in the root andscripts/vagrant/provision.sh
to see what goes on. You might have to runvagrant up
as admin (and enable it to create new directories on your computer). Runningvagrant up
should create two directories under your user:.vagrant.d
and.VirtualBox
. - Enter your VirtualBox with
vagrant ssh
. - Now you are inside the virtual environment and you can start the server with
./dev-runserver.sh
. Browse to localhost:8080 to see your local version of the AIS!
- Download and install Vagrant and VirtualBox.
- Clone the AIS repo via SSH and cd into it (new to SSH? See how to generate a new SSH key and how to add it to your GitHub account)
git clone [email protected]:armada-ths/ais.git cd ais
- Run
vagrant up
. This will create your virtual machine containing the AIS system. You can view your virtual machine in the Virtualbox GUI. Take a look at the Vagrantfile in the root andscripts/vagrant/provision.sh
to see what goes on. You might have to runvagrant up
as admin (and enable it to create new directories on your computer). Runningvagrant up
should create two directories under your user:.vagrant.d
and.VirtualBox
. - Enter your VirtualBox with
vagrant ssh
. - Start the server with
./dev-runserver.sh
. Browse to localhost:8080 to see your local version of the AIS!
When setting up your local machine a database user and database will be created with the name ais_dev
. We want to replace this one with a bigger database that is a copy of the real one to make sure our developing environment is as real as possible. Download and store the ais-developer-database.sql
file in your AIS directory root (ask the current Head of Internal Systems from where you can download this file).
This database is different from the "real" one in the following ways:
- It has the accounts listed in this document to be used for testing.
- It does not have all applications for each recruitment period.
- It has some default phone numbers and email addresses for the banquet- and university relations participants.
After vagrant up
and vagrant ssh
:
Log into psql as postgres user: psql -U postgres
Drop the old database: drop database ais_dev;
Quit psql: \q
Now create the database as user postgres: psql -U postgres < ais-developer-database.sql
-
For developers
-
API
-
For Head of Internal Systems