diff --git a/scripts/_common.sh b/scripts/_common.sh index ae5596c..6997dc6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -33,11 +33,13 @@ log_file="${log_path}/${app}.log" _install_scovie_venv() { ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv" + venvpython="$install_dir/venv/bin/python3" + ynh_add_config --template="requirements.txt" --destination="$install_dir/requirements.txt" - 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" + ynh_exec_as "$app" "$venvpython" -m ensurepip + ynh_exec_as "$app" "$venvpython" -m pip install --upgrade wheel pip setuptools + ynh_exec_as "$app" "$venvpython" -m pip install --no-deps -r "$install_dir/requirements.txt" } #================================================= diff --git a/scripts/install b/scripts/install index be0c158..9174c84 100644 --- a/scripts/install +++ b/scripts/install @@ -64,17 +64,17 @@ ynh_script_progression --message="migrate/collectstatic/createadmin..." --weight pushd "$install_dir" # Just for debugging: - ynh_exec_as "$app" ./manage.py diffsettings + ynh_exec_as "$app" "$venvpython" ./manage.py diffsettings - ynh_exec_as "$app" ./manage.py migrate --no-input - ynh_exec_as "$app" ./manage.py collectstatic --no-input + ynh_exec_as "$app" "$venvpython" ./manage.py migrate --no-input + ynh_exec_as "$app" "$venvpython" ./manage.py collectstatic --no-input # Create/update Django superuser (set unusable password, because auth done via SSOwat): - ynh_exec_as "$app" ./manage.py create_superuser --username="$admin" --email="$(ynh_user_get_info "$admin" mail)" + ynh_exec_as "$app" "$venvpython" ./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. - ynh_exec_as "$app" ./manage.py check --deploy || true + ynh_exec_as "$app" "$venvpython" ./manage.py check --deploy || true popd #================================================= @@ -87,7 +87,7 @@ ynh_add_nginx_config # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_systemd_config --service="$app" --template="systemd.service" -yunohost service add "$app" --description=Digital signage system for high schools --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Digital signage system for high schools" --log="/var/log/$app/$app.log" # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate "/var/log/$app/$app.log"