From c2736877e78f5ca7834242f46c64a2daec620117 Mon Sep 17 00:00:00 2001 From: terrtia Date: Mon, 9 Dec 2024 14:10:45 +0100 Subject: [PATCH] chg: [v6.0] add v6.0 update script --- update/v6.0/Update.py | 28 ++++++++++++++++++++++++++ update/v6.0/Update.sh | 38 ++++++++++++++++++++++++++++++++++++ var/www/update_thirdparty.sh | 6 +++--- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100755 update/v6.0/Update.py create mode 100755 update/v6.0/Update.sh diff --git a/update/v6.0/Update.py b/update/v6.0/Update.py new file mode 100755 index 00000000..f264c924 --- /dev/null +++ b/update/v6.0/Update.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# -*-coding:UTF-8 -* + +import os +import sys + +sys.path.append(os.environ['AIL_HOME']) +################################## +# Import Project packages +################################## +from update.bin.ail_updater import AIL_Updater +from lib.ConfigLoader import ConfigLoader +from lib import ail_updates + +class Updater(AIL_Updater): + """default Updater.""" + + def __init__(self, version): + super(Updater, self).__init__(version) + + +if __name__ == '__main__': + config_loader = ConfigLoader() + r_queues = config_loader.get_redis_conn("Redis_Queues") + config_loader = None + r_queues.delete('modules') + updater = Updater('v6.0') + updater.run_update() diff --git a/update/v6.0/Update.sh b/update/v6.0/Update.sh new file mode 100755 index 00000000..69f36350 --- /dev/null +++ b/update/v6.0/Update.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; +[ -z "$AIL_REDIS" ] && echo "Needs the env var AIL_REDIS. Run the script from the virtual environment." && exit 1; +[ -z "$AIL_BIN" ] && echo "Needs the env var AIL_ARDB. Run the script from the virtual environment." && exit 1; +[ -z "$AIL_FLASK" ] && echo "Needs the env var AIL_FLASK. Run the script from the virtual environment." && exit 1; + +export PATH=$AIL_HOME:$PATH +export PATH=$AIL_REDIS:$PATH +export PATH=$AIL_BIN:$PATH +export PATH=$AIL_FLASK:$PATH + +GREEN="\\033[1;32m" +DEFAULT="\\033[0;39m" + +echo -e $GREEN"Shutting down AIL ..."$DEFAULT +bash ${AIL_BIN}/LAUNCH.sh -ks +wait + +echo -e $GREEN"Updating UI resources..."$DEFAULT +bash ${AIL_BIN}/LAUNCH.sh -ut +wait + +echo -e $GREEN"Updating python requirement..."$DEFAULT +pip install -U flask-sock + +# SUBMODULES # +git submodule update + +echo "" +echo -e $GREEN"Updating AIL VERSION ..."$DEFAULT +echo "" +python ${AIL_HOME}/update/v6.0/Update.py +wait +echo "" +echo "" + +exit 0 diff --git a/var/www/update_thirdparty.sh b/var/www/update_thirdparty.sh index 5db61adb..c0dc7e01 100755 --- a/var/www/update_thirdparty.sh +++ b/var/www/update_thirdparty.sh @@ -67,6 +67,9 @@ wget https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js -O ./static/ wget https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css -O ./static/css/dataTables.bootstrap.min.css wget https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js -O ./static/js/dataTables.bootstrap.min.js +#Ressource for graph +wget https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js -O ./static/js/echarts.min.js + #Ressources for bootstrap popover POPPER_VERSION="1.16.1" wget https://github.com/FezVrasta/popper.js/archive/v${POPPER_VERSION}.zip -O temp/popper.zip @@ -74,9 +77,6 @@ unzip -qq temp/popper.zip -d temp/ mv temp/floating-ui-${POPPER_VERSION}/dist/umd/popper.min.js ./static/js/ mv temp/floating-ui-${POPPER_VERSION}/dist/umd/popper.min.js.map ./static/js/ -#Ressource for graph -# DASHBOARD # TODO Extract from github -wget https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js - O ./static/js/echarts.min.js