[OUTDATED] The (old) installation script: usage

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:

  1. Check if the required dependencies are installed; if not, quit
  2. Download the virtual machine from AEGEE homestead
  3. Create the folder structure and download the core/events repositiories
  4. 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):

  1. (CORE)Configuring the laravel .env file
  2. (CORE)Downloading laravel dependencies and initialising the framework
  3. (EVENTS) Downloading node dependencies
  4. (EVENTS) Hooking up nginx settings for reverse proxy
  5. (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 (default credentials: ask them in HipChat) 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/ | bash 
or save it from the gist link above, place it in your project root, and run it