Skip to content

Commit

Permalink
chg: [v6.0] add v6.0 update script
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Dec 9, 2024
1 parent 849977f commit c273687
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 3 deletions.
28 changes: 28 additions & 0 deletions update/v6.0/Update.py
Original file line number Diff line number Diff line change
@@ -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 changes: 38 additions & 0 deletions update/v6.0/Update.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions var/www/update_thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ 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/[email protected]/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
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/[email protected]/dist/echarts.min.js - O ./static/js/echarts.min.js



Expand Down

0 comments on commit c273687

Please sign in to comment.