chg: [v6.0] add v6.0 update script
Some checks are pending
CI / ail_test (3.8) (push) Waiting to run
CI / ail_test (3.9) (push) Waiting to run
CI / ail_test (3.10) (push) Waiting to run
CI / ail_test (3.7) (push) Waiting to run

This commit is contained in:
terrtia 2024-12-09 14:10:45 +01:00
parent 849977f0c2
commit c2736877e7
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
3 changed files with 69 additions and 3 deletions

28
update/v6.0/Update.py Executable file
View file

@ -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()

38
update/v6.0/Update.sh Executable file
View file

@ -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

View file

@ -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/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 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 #Ressources for bootstrap popover
POPPER_VERSION="1.16.1" POPPER_VERSION="1.16.1"
wget https://github.com/FezVrasta/popper.js/archive/v${POPPER_VERSION}.zip -O temp/popper.zip 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 ./static/js/
mv temp/floating-ui-${POPPER_VERSION}/dist/umd/popper.min.js.map ./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