1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pytition_ynh.git synced 2024-09-03 20:16:08 +02:00

Fix upgrade.

This commit is contained in:
Félix Piédallu 2022-04-14 13:46:27 +02:00 committed by Salamandar
parent cd647b934c
commit 754477db25
3 changed files with 8 additions and 5 deletions

View file

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

View file

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

View file

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