1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coin_ynh.git synced 2024-09-03 18:16:26 +02:00

Fix upgrade

This commit is contained in:
yalh76 2022-03-14 20:39:33 +01:00
parent 15a125ccba
commit 654da9fa26
2 changed files with 20 additions and 11 deletions

View file

@ -113,13 +113,14 @@ ynh_add_nginx_config
#================================================= #=================================================
# PYTHON DEPENDENCIES # PYTHON DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing more dependencies..." ynh_script_progression --message="Installing more dependencies..."
virtualenv "$final_path/venv" virtualenv "$final_path/venv"
( (
set +o nounset set +o nounset
source "${final_path}/venv/bin/activate" source "${final_path}/venv/bin/activate"
set -o nounset set -o nounset
$final_path/venv/bin/pip install --upgrade pip $final_path/venv/bin/pip install --upgrade pip
$final_path/venv/bin/pip install gunicorn $final_path/venv/bin/pip install gunicorn
echo "django-auth-ldap<1.4" >> $final_path/requirements.txt echo "django-auth-ldap<1.4" >> $final_path/requirements.txt
@ -129,7 +130,6 @@ virtualenv "$final_path/venv"
#================================================= #=================================================
# CONFIGURATION DJANGO # CONFIGURATION DJANGO
#================================================= #=================================================
ynh_script_progression --message="Configuring application..." ynh_script_progression --message="Configuring application..."
export prefix="${path_url#"/"}/" export prefix="${path_url#"/"}/"

View file

@ -125,14 +125,15 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# CONFIGURATION DJANGO # CONFIGURE DJANGO
#================================================= #=================================================
ynh_script_progression --message="Configuring Django..."
export prefix="${path_url#"/"}/" export prefix="${path_url#"/"}/"
prefix=${prefix%"/"} prefix=${prefix%"/"}
ynh_backup_if_checksum_is_different --file="$final_path/app/settings_local.py" ynh_backup_if_checksum_is_different --file="$final_path/coin/settings_local.py"
ynh_render_template ../conf/local.py.j2 "$final_path/app/setings_local.py" ynh_render_template ../conf/local.py.j2 "$final_path/coin/setings_local.py"
ynh_store_file_checksum --file="$final_path/app/settings_local.py" ynh_store_file_checksum --file="$final_path/coin/settings_local.py"
virtualenv "$final_path/venv" virtualenv "$final_path/venv"
( (
@ -143,18 +144,26 @@ virtualenv "$final_path/venv"
#================================================= #=================================================
# PYTHON DEPENDENCIES # PYTHON DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing more dependencies..."
echo "django-auth-ldap<1.4" >> $final_path/requirements.txt echo "django-auth-ldap<1.4" >> $final_path/requirements.txt
$final_path/venv/bin/pip install -r $final_path/requirements.txt $final_path/venv/bin/pip install -r $final_path/requirements.txt
#================================================= #=================================================
# MIGRATE DB # MIGRATE DB
#================================================= #=================================================
ynh_script_progression --message="Migrating database..."
pushd $final_path
$final_path/venv/bin/python manage.py migrate --noinput $final_path/venv/bin/python manage.py migrate --noinput
#================================================= #=================================================
# COLLECT FILES # COLLECT FILES
#================================================= #=================================================
ynh_script_progression --message="Collecting files..."
$final_path/venv/bin/python manage.py collectstatic --noinput $final_path/venv/bin/python manage.py collectstatic --noinput
popd
) )
chmod 750 "$final_path" chmod 750 "$final_path"