Introduction
This script can be launched by any POSIX-compliant console (Tested on Linux with bash and OSX with zsh).
It is very important to be in the directory that you want to set as project root before launching the script (e.g. ~/Documents/code/AEGEE/), and to not move the folders around after the installation (e.g. move the folder AEGEE altogether, or not at all).
Launch it from the desired folder and it will do the following:
- Check if the required dependencies are installed; if not, quit
- Download the virtual machine from AEGEE homestead
- Create the folder structure and download the core/events repositiories
- Bootstrap the machine with vagrant and run the provisioning scripts, modified for our purpose
All of this happens on the host machine. The final stage of provisioning consists of (in the guest VM):
- (CORE)Configuring the laravel .env file
- (CORE)Downloading laravel dependencies and initialising the framework
- (EVENTS) Downloading node dependencies
- (EVENTS) Hooking up nginx settings for reverse proxy
- (EVENTS) Registering the microservice to core
Once the script has been launched and its execution has ended, all is left to do is to go on http://localhost:8000/moduleMangement and confirm the module. The system is ready to use.
Development
go to your {project root}/oms-homestead and run
$ vagrant ssh
Alternatively run from anywhere (even from other computers in the same network)
$ ssh -p 2222 vagrant@localhost
If you are on your host you will not be prompted for password; otherwise the password is vagrant
Once connected you will have a folder called oms-project which is mapping the content of oms-project on your host. This means that you can work on your host machine, save the content, and automatically have it on the server (i.e. you have a seamless way to see your changes reflected, after restarting nginx).
For node development (e.g. EVENTS) there is a tmux shell running the node instance. Attach to the tmux instance (called Workspace):
$ tmux attach -t Workspace
you will see the console of the node process. From there you can see the logs or stop it in order to restart. Once you stop it for the first time, if you are not familiar with tmux I advise you to restart the node service outside tmux - in other words, once you press ^C to stop node, press ^D to exit tmux. Then run the command (assuming you are into /home/vagrant/oms-project/oms-events-module)
$ node lib/server.js
The script
find it here on gist
Usage
Go to the folder you want to set as project root, with a terminal, then launch the following:
$ curl https://gist.githubusercontent.com/linuxbandit/641bfea3fcd203f6d234afd728de50fd/raw/08ff4e87d53926bef54c2d71004daa34129a78d2/aegee-homestead-install.sh | bash
or save it from the gist link above, place it in your project root, and run it