#!/bin/bash mode="dev" if [[ $* =~ ^(prod)$ ]]; then mode="prod" fi if [ $mode == "dev" ]; then echo "[Installing AURA ENGINE for Development]" fi if [ $mode == "prod" ]; then echo "[Installing AURA ENGINE for Production]" fi # Development and Production echo "Installation OPAM Packages ..." bash script/install-opam-packages.sh echo "Installing Web Application Packages ..." bash script/install-web.sh echo "Installing Python Requirements ..." python3.7 $(which pip3) install -r requirements.txt # Development if [ $mode == "dev" ]; then echo "Create local 'logs' Folder ..." mkdir -p logs echo "Copy configuration to './configuration/engine.ini'" cp -n configuration/sample-development.engine.ini configuration/engine.ini fi # Production if [ $mode == "prod" ]; then echo "Create local 'tmp' Folder ..." mkdir -p tmp echo "Copy configuration to '/etc/aura/engine.ini'" cp -n configuration/sample-production.engine.ini /etc/aura/engine.ini # echo "Copy Supervisor Config to '/etc/supervisor/conf.d'" # cp configuration/supervisor/* /etc/supervisor/conf.d/ # echo "Refresh Supervisor Config" # supervisord -c /opt/aura/engine/configuration/supervisor/supervisord.conf reread # echo "Update Supervisor Configuration" # supervisorctl -c /opt/aura/engine/configuration/supervisor/supervisord.conf update echo "Refresh Supervisor Config" supervisord reread echo "Update Supervisor Configuration" supervisorctl update fi echo echo "+++ Installation of AURA Engine finished! +++" echo