mirror of
https://github.com/YunoHost-Apps/scovie_ynh.git
synced 2024-09-03 20:16:29 +02:00
fix python calls
This commit is contained in:
parent
0b53c96d91
commit
f2bc4d862f
2 changed files with 11 additions and 9 deletions
|
@ -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"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue