From fe11e931025727387a2ed108e9bdbcb826e7953e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 14 Apr 2022 13:46:27 +0200 Subject: [PATCH] Fix upgrade. --- check_process | 4 ++-- scripts/change_url | 1 + scripts/upgrade | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index daa4523..36b4ab7 100644 --- a/check_process +++ b/check_process @@ -17,8 +17,8 @@ setup_nourl=0 setup_private=1 setup_public=1 - ;upgrade=1 - ;upgrade=1 from_commit=CommitHash + upgrade=1 + upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 change_url=1 diff --git a/scripts/change_url b/scripts/change_url index 896ee56..6d67d81 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -104,6 +104,7 @@ then # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" domain="$new_domain" + path_url="$new_path" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 453e141..e0f60f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,8 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # CHECK VERSION @@ -131,13 +133,13 @@ ynh_install_app_dependencies "${pkg_dependencies[@]}" #================================================= ynh_script_progression --message="Upgrading python dependencies..." --weight=1 -python3 -m venv --upgrade ENV_DIR ( set +o nounset source "${final_path}/venv/bin/activate" set -o nounset - python3 -m pip install -r requirements.txt --upgrade + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade -r "$final_path/pytition/requirements.txt" ) #================================================= @@ -167,7 +169,7 @@ ynh_exec_as $app bash -c " cd '$final_path/pytition/pytition' export DJANGO_SETTINGS_MODULE=pytition.settings.config python3 manage.py migrate - python3 manage.py collectstatic + python3 manage.py collectstatic --clear --noinput python3 manage.py compilemessages "