From 9c0e019d67c8a87334167ef572b5c651678d34fc Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Fri, 13 Mar 2020 13:35:35 +0100 Subject: [PATCH] Instalation script extension for production. --- install.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 74329d0..eed16fe 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,52 @@ +#/usr/bin/bash +mode="dev" + + +if [ -n "$2" ]; then + if [[ $1 =~ ^(prod)$ ]]; then + mode=$1 + fi +fi + +if [ $mode == "dev" ]; then + echo "[Installing AURA ENGINE for Development]" +fi +if [ $mode == "prod" ]; then + echo "[Installing AURA ENGINE for Production]" +fi + + +# Production + +if [ $mode == "api" ]; then + if getent passwd 'engineuser' > /dev/null 2>&1; then + echo "User 'engineuser' exists already."; + else + echo "Creating Engine User ..." + adduser engineuser + adduser engineuser sudo + fi + + echo "Set Ownership of '/opt/aura/engine' to Engine User" + chown -R engineuser:engineuser . + + echo "Copy Supervisor Config to '/etc/supervisor/conf.d'" + cp configuration/supervisor/engine-api.conf /etc/supervisor/conf.d/ + + echo "Create Log Directory `/var/log/aura/engine`" + mkdir -p /var/log/aura + mkdir -p /var/log/aura/engine + + echo "Create Configuration Directory `/etc/aura/engine`" + mkdir -p /etc/aura + mkdir -p /etc/aura/engine +fi + + +# Development and Production echo "Installing Web Application Packages ..." -sudo ./install-web.sh +./install-web.sh echo "Installing Python Requirements ..." python3.7 $(which pip3) install -r requirements.txt \ No newline at end of file -- GitLab