From 454280f5138626e522bbde2e303294ea854e28a1 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 30 Mar 2021 00:34:10 -0400 Subject: [PATCH] Bump version and fix envdir calls --- hooks/post_user_delete | 7 +++---- manifest.json | 2 +- scripts/install | 7 +++---- scripts/upgrade | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/hooks/post_user_delete b/hooks/post_user_delete index 5fc0224..6c8b031 100644 --- a/hooks/post_user_delete +++ b/hooks/post_user_delete @@ -9,9 +9,8 @@ purge=$2 final_path=$(ynh_app_setting_get --app=$app --key=final_path) env_path=$final_path/envs/prod -pushd $final_path - source $final_path/venv/bin/activate - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py shell <<< " +pushd $final_path || ynh_die + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py shell <<< " from django.contrib.auth import get_user_model User = get_user_model() try: @@ -23,4 +22,4 @@ try: except User.DoesNotExist: pass " -popd \ No newline at end of file +popd || ynh_die diff --git a/manifest.json b/manifest.json index 1841611..6a45f0c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage podcast subscriptions, and sync them between apps and devices", "fr": "GĂ©rez vos sousciptions balado, et sychronisez-lez entre vos applis et appareils" }, - "version": "2.11.1~ynh2", + "version": "2.11.1~ynh3", "url": "https://github.com/gpodder/mygpo", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/install b/scripts/install index 8ba34b6..473c64d 100755 --- a/scripts/install +++ b/scripts/install @@ -119,7 +119,6 @@ chown -R $app:$app $datadir chmod o-rwx $datadir setfacl -n -R -m user:www-data:rx -m default:user:www-data:rx $datadir - ynh_app_setting_set --app=$app --key=datadir --value="$datadir" #================================================= @@ -164,9 +163,9 @@ popd || ynh_die #================================================= pushd $final_path || ynh_die chown -R root:$app $final_path - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py makemigrations - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py migrate - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py createsuperuser --username "$admin" --email "$admin_email" --noinput -v 0 + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py makemigrations + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py migrate + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py createsuperuser --username "$admin" --email "$admin_email" --noinput -v 0 chown -R root:root $final_path popd || ynh_die diff --git a/scripts/upgrade b/scripts/upgrade index 8b65935..d1227fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,8 +114,8 @@ ynh_script_progression --message="Performing database migrations..." --weight=2 pushd $final_path || ynh_die chown -R root:$app $final_path - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py makemigrations - sudo -u $app $final_path/venv/bin/envdir $env_path python3 $final_path/manage.py migrate + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py makemigrations + sudo -u $app $final_path/venv/bin/envdir $env_path $final_path/venv/bin/python $final_path/manage.py migrate chown -R root:root $final_path popd || ynh_die