Skip to content
Snippets Groups Projects
run.sh 1000 B
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/bash
    
    David Trattnig's avatar
    David Trattnig committed
    mode="engine"
    
    if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then 
    	mode=$1 
    
    David Trattnig's avatar
    David Trattnig committed
    fi
    
    echo "[ Run mode=$mode ]"
    
    
    
    ### Runs Engine Core & Liquidsoap ###
    
    if [[ $mode == "engine" ]]; then
    	/usr/bin/env python3.7 engine-core.py
    fi
    
    ### Runs Engine Core only ###
    
    if [[ $mode == "core" ]]; then
    	/usr/bin/env python3.7 engine-core.py --without-lqs
    
    ### Runs Liquidsoap only ###
    
    if [[ $mode == "lqs" ]]; then
    	lqs=$(/usr/bin/env python3.7 engine-core.py --get-lqs-command)
    	eval "$lqs"
    
    ### Runs the API Server (Development) ###
    
    if [[ $mode == "api-dev" ]]; then
    
    	echo "Building Web Applications"
    	sh ./script/build-web.sh
    	echo "Starting API Server"
    
    	/usr/bin/env python3.7 engine-api.py
    
    ### Runs the API Server (Production) ###
    
    if [[ $mode == "api" ]]; then
    
    	echo "Building Web Applications"
    	sh ./script/build-web.sh
    
    	echo "Activating Python Environment"
    	source ../python-env/bin/activate
    
    	echo "Starting API Server"
    
    	gunicorn -c configuration/gunicorn.conf.py engine-api:app
    
    David Trattnig's avatar
    David Trattnig committed
    fi