Skip to content
Snippets Groups Projects
install.sh 1.55 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Trattnig's avatar
    David Trattnig committed
    #!/bin/bash
    
    David Trattnig's avatar
    David Trattnig committed
    if [[ $* =~ ^(prod)$ ]]; then 
    
    David Trattnig's avatar
    David Trattnig committed
    	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 
    
    David Trattnig's avatar
    David Trattnig committed
    if [ $mode == "dev" ]; then
    
    
        echo "Create local 'logs' Folder ..."
    
    David Trattnig's avatar
    David Trattnig committed
        echo "Copy configuration to './configuration/engine.ini'"
    
        cp -n configuration/sample-development.engine.ini configuration/engine.ini
    
    David Trattnig's avatar
    David Trattnig committed
    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
    
    echo 
    
    David Trattnig's avatar
    David Trattnig committed
    echo "+++ Installation of AURA Engine finished! +++"
    echo