From 20bf47e1fecf791ac210b031b84f991103a48c09 Mon Sep 17 00:00:00 2001 From: Laurent GAY Date: Fri, 26 Jul 2024 11:07:09 +0200 Subject: [PATCH] refactoring update_software --- scripts/_common.sh | 10 ++++++++++ scripts/change_url | 6 ++++-- scripts/restore | 6 +----- scripts/upgrade | 6 +----- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4a4f8a1..883663d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -45,3 +45,13 @@ function check_params() venv/bin/lucterios_admin.py security -n inst-${app} -e "MODE=0" popd } + + +function update_software() +{ + pushd $install_dir + venv/bin/lucterios_admin.py check + venv/bin/lucterios_admin.py update + venv/bin/lucterios_admin.py refreshall + popd +} \ No newline at end of file diff --git a/scripts/change_url b/scripts/change_url index 6bf402f..1f13164 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -42,10 +42,12 @@ then fi extra_json=$(jq -c . /tmp/extra.json) venv/bin/lucterios_admin.py modif -n inst-${app} -e ''$extra_json'' -venv/bin/lucterios_admin.py update -venv/bin/lucterios_admin.py refreshall popd +update_software + +refresh_collect + #================================================= # START SUPERVISOR SERVICE #================================================= diff --git a/scripts/restore b/scripts/restore index c95a8c2..16ffc84 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,11 +38,7 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < dbb #================================================= ynh_script_progression --message="Refresh the app main directory..." --weight=1 -pushd $install_dir -venv/bin/lucterios_admin.py check -venv/bin/lucterios_admin.py update -venv/bin/lucterios_admin.py refreshall -popd +update_software refresh_collect diff --git a/scripts/upgrade b/scripts/upgrade index 2e61de6..e359356 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,11 +17,7 @@ supervisorctl stop ${app} #================================================= ynh_script_progression --message="Updating Diacamma..." -pushd $install_dir -venv/bin/lucterios_admin.py check -venv/bin/lucterios_admin.py update -venv/bin/lucterios_admin.py refreshall -popd +update_software refresh_collect