mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
commit
e6a4dc556e
6 changed files with 8 additions and 14 deletions
|
@ -17,11 +17,14 @@ admindoc = "https://samr1.github.io/FitTrackee"
|
||||||
code = "https://github.com/SamR1/FitTrackee"
|
code = "https://github.com/SamR1/FitTrackee"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2.5"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
||||||
ldap = false
|
ldap = false
|
||||||
|
|
||||||
sso = false
|
sso = false
|
||||||
|
|
||||||
disk = "50M"
|
disk = "50M"
|
||||||
ram.build = "50M"
|
ram.build = "50M"
|
||||||
ram.runtime = "50M"
|
ram.runtime = "50M"
|
||||||
|
|
|
@ -31,11 +31,9 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}.service"
|
ynh_backup --src_path="/etc/systemd/system/${app}.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}_workers.service"
|
ynh_backup --src_path="/etc/systemd/system/${app}_workers.service"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE POSTGRESQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -14,6 +14,7 @@ admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOGROTATE
|
# LOGROTATE
|
||||||
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1
|
ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
|
@ -25,7 +26,6 @@ chown -R $app:www-data /var/log/$app/
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
#=================================================
|
|
||||||
# CONFIGURE THE INSTALL SCRIPT
|
# CONFIGURE THE INSTALL SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ ynh_script_progression --message="Adding system configurations related to $app .
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
|
@ -97,6 +98,7 @@ ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
|
@ -105,16 +107,15 @@ ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log"
|
yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log"
|
||||||
yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log"
|
yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
#=================================================
|
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting the systemd services..." --weight=15
|
ynh_script_progression --message="Starting the systemd services..." --weight=15
|
||||||
|
|
|
@ -39,7 +39,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||||
ynh_remove_systemd_config --service="${app}"
|
ynh_remove_systemd_config --service="${app}"
|
||||||
ynh_remove_systemd_config --service="${app}_workers"
|
ynh_remove_systemd_config --service="${app}_workers"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE VARIOUS FILES
|
# REMOVE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -56,7 +55,6 @@ ynh_secure_remove --file="/var/log/$app"
|
||||||
# Remove the redis database
|
# Remove the redis database
|
||||||
ynh_redis_remove_db "$redis_db"
|
ynh_redis_remove_db "$redis_db"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -28,7 +28,6 @@ chown -R $app:www-data /var/log/$app/
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
|
@ -32,13 +32,11 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
ynh_systemd_action --action="stop" --service_name="${app}"
|
ynh_systemd_action --action="stop" --service_name="${app}"
|
||||||
ynh_systemd_action --action="stop" --service_name="${app}_workers"
|
ynh_systemd_action --action="stop" --service_name="${app}_workers"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=23
|
ynh_script_progression --message="Installing dependencies..." --weight=23
|
||||||
|
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app: "$install_dir"
|
chown -R $app: "$install_dir"
|
||||||
|
|
||||||
|
@ -80,7 +78,6 @@ pushd $install_dir
|
||||||
ynh_exec_warn_less pip install fittrackee==$fittrackee_version
|
ynh_exec_warn_less pip install fittrackee==$fittrackee_version
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Update DATABASE
|
# Update DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -88,7 +85,6 @@ ynh_script_progression --message="Upgrading database..." --weight=1
|
||||||
|
|
||||||
ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade
|
ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -106,7 +102,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||||
ynh_add_systemd_config --service="${app}" --template="fittrackee.service"
|
ynh_add_systemd_config --service="${app}" --template="fittrackee.service"
|
||||||
ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers.service"
|
ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers.service"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue