From ac93ea218d9172ea319a67b399f2fa0832f52865 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 15 Dec 2019 05:37:47 +0000 Subject: [PATCH] add update script --- update.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 00000000..49402ccc --- /dev/null +++ b/update.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +sudo systemctl stop celery +sudo systemctl stop celerybeat +sudo systemctl stop rmm +sudo systemctl stop nginx +cd /home/${USER}/rmm/ +git pull +source /home/${USER}/rmm/api/env/bin/activate +cd /home/${USER}/rmm/api/tacticalrmm +pip install -r /home/${USER}/rmm/api/tacticalrmm/requirements.txt +python manage.py makemigrations +python manage.py migrate +deactivate + + +rm -rf /home/${USER}/rmm/web/node_modules +rm -rf /home/${USER}/rmm/web/dist +cd /home/${USER}/rmm/web +npm install +npm run build +sudo rm -rf /var/www/rmm/dist +sudo cp -pvr /home/${USER}/rmm/web/dist /var/www/rmm/ +sudo chown www-data:www-data -R /var/www/rmm/dist + +sudo systemctl start celery +sudo systemctl start celerybeat +sudo systemctl start rmm +sudo systemctl start nginx