1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fittrackee_ynh.git synced 2024-09-03 18:36:16 +02:00
This commit is contained in:
oufmilo 2023-02-06 11:17:52 +01:00
parent dd0e012182
commit 0136287073
2 changed files with 9 additions and 25 deletions

View file

@ -5,7 +5,7 @@
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="postgresql postgresql-contrib python3 python3-venv libpq-dev docker-compose-plugin" pkg_dependencies="postgresql postgresql-contrib python3-venv libpq-dev"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -21,14 +21,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) #db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$(ynh_app_setting_get --app=$app --key=db_user) #db_user=$(ynh_app_setting_get --app=$app --key=db_user)
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
admin_mail=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=username)
key=$(ynh_string_random --length=32) #key=$(ynh_string_random --length=32)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -92,6 +92,7 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#================================================= #=================================================
# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES # CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES
#================================================= #=================================================
@ -107,15 +108,9 @@ $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
#================================================= #=================================================
ynh_script_progression --message="Upgrading database..." --weight=1 ynh_script_progression --message="Upgrading database..." --weight=1
pushd "$final_path" $final_path/venv/bin/python3 "$final_path/manage.py" migrate
docker-compose build $final_path/venv/bin/python3 "$final_path/manage.py" collectstatic --no-input
docker-compose run --rm web python manage.py migrate $final_path/venv/bin/python3 "$final_path/manage.py" populate_streams
docker-compose run --rm web python manage.py compile_themes
docker-compose run --rm web python manage.py collectstatic --no-input
docker-compose down
docker-compose up -d
docker-compose run --rm web python manage.py populate_streams
popd
#================================================= #=================================================
# SET PERMISSIONS ON BOOKWYRM DIRECTORY # SET PERMISSIONS ON BOOKWYRM DIRECTORY
@ -131,17 +126,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a config file..." --weight=1
ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env"
chmod 600 $final_path/.env
chown $app:www-data "$final_path/.env"
set -a; source "$final_path/.env"; set +a
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================