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

Simplify restore script

This commit is contained in:
Salamandar 2024-01-18 20:59:05 +01:00
parent f4accb2017
commit afe00c036e

View file

@ -28,30 +28,10 @@ ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name"
#================================================= #=================================================
# PYTHON VIRTUALENV # PYTHON VIRTUALENV
# Maybe the backup contains a other Python version
#================================================= #=================================================
ynh_script_progression --message="Recreate Python virtualenv..." --weight=5 ynh_script_progression --message="Update Python virtualenv..." --weight=5
# Always recreate everything fresh with current python version python3 -m venv --upgrade --without-pip "$install_dir/venv"
ynh_secure_remove "${install_dir}/venv"
# Skip pip because of: https://github.com/YunoHost/issues/issues/1960
python3 -m venv --without-pip "${install_dir}/venv"
chown -R "$app:" "$install_dir"
#=================================================
# PIP INSTALLATION
#=================================================
ynh_script_progression --message="Install project via pip..." --weight=45
#run source in a 'sub shell'
(
set +o nounset
source "${install_dir}/venv/bin/activate"
set -o nounset
ynh_exec_as $app $install_dir/venv/bin/python3 -m ensurepip
ynh_exec_as $app $install_dir/venv/bin/pip3 install --upgrade wheel pip setuptools
ynh_exec_as $app $install_dir/venv/bin/pip3 install --no-deps -r "$install_dir/requirements.txt"
)
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS