Skip to content
Snippets Groups Projects
install.sh 1.16 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
    
    
    # Find the correct Python version (3.7 or 3.8)
    
    
    if hash python3.9 2>/dev/null; then
    	PYTHON_EXEC="python3.9"
    	echo "[ Using Python 3.9 ]"
    else
    
    	PYTHON_EXEC="python3.8"
    	echo "[ Using Python 3.8 ]"
    fi
    
    # Development and Production
    
    
    echo "Installing OPAM Packages ..."
    
    bash scripts/install-opam-packages.sh
    
    echo "Installing Python Requirements ..."
    
    $PYTHON_EXEC $(which pip3) install -r requirements.txt
    
    # Development 
    
    David Trattnig's avatar
    David Trattnig committed
    if [ $mode == "dev" ]; then
    
    
        echo "Create local 'logs' Folder ..."
    
        echo "Copy configuration to './config/engine.ini'"
        cp -n config/sample-development.engine.ini config/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 default Engine configuration to '/etc/aura/engine.ini'"
    
        cp -n config/sample-production.engine.ini /etc/aura/engine.ini
    
    echo 
    
    David Trattnig's avatar
    David Trattnig committed
    echo "+++ Installation of AURA Engine finished! +++"
    echo