From b9df988fab0e9dbab54f33924086efeef356bb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 15:07:47 +0100 Subject: [PATCH] update upgrade --- scripts/upgrade | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 25f03ed..e7c8645 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,20 +76,20 @@ ynh_add_config --template="wsgi.py" --destination="$install_dir/wsgi.py" #================================================= ynh_script_progression --message="migrate/collectstatic/createadmin..." --weight=10 -cd "$install_dir" || exit +pushd "$install_dir" + # Just for debugging: + ynh_exec_as "$app" "$venvpython" ./manage.py diffsettings -# Just for debugging: -./manage.py diffsettings + ynh_exec_as "$app" "$venvpython" ./manage.py migrate --no-input + ynh_exec_as "$app" "$venvpython" ./manage.py collectstatic --no-input -./manage.py migrate --no-input -./manage.py collectstatic --no-input + # Create/update Django superuser (set unusable password, because auth done via SSOwat): + ynh_exec_as "$app" "$venvpython" ./manage.py create_superuser --username="$admin" --email="$(ynh_user_get_info "$admin" mail)" -# Create/update Django superuser (set unusable password, because auth done via SSOwat): -./manage.py create_superuser --username="$admin" --email="$(ynh_user_get_info "$admin" mail)" - -# Check the configuration -# This may fail in some cases with errors, etc., but the app works and the user can fix issues later. -./manage.py check --deploy || true + # Check the configuration + # This may fail in some cases with errors, etc., but the app works and the user can fix issues later. + ynh_exec_as "$app" "$venvpython" ./manage.py check --deploy || true +popd #================================================= # REAPPLY SYSTEM CONFIGURATIONS