1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/endi_ynh.git synced 2024-09-03 18:35:54 +02:00

Merge pull request #26 from YunoHost-Apps/testing

Testing
This commit is contained in:
Salamandar 2024-06-29 12:11:44 +02:00 committed by GitHub
commit ba7fd26b40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 20 additions and 118 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# enDI for YunoHost # enDI for YunoHost
[![Integration level](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![Working status](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![Working status](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![Install enDI with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![Install enDI with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -5,7 +5,7 @@ No se debe editar a mano.
# enDI para Yunohost # enDI para Yunohost
[![Nivel de integración](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![Nivel de integración](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![Instalar enDI con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![Instalar enDI con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -5,7 +5,7 @@ EZ editatu eskuz.
# enDI YunoHost-erako # enDI YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![Integrazio maila](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![Instalatu enDI YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![Instalatu enDI YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.
# enDI pour YunoHost # enDI pour YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![Niveau dintégration](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![Installer enDI avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![Installer enDI avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -5,7 +5,7 @@ NON debe editarse manualmente.
# enDI para YunoHost # enDI para YunoHost
[![Nivel de integración](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![Nivel de integración](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![Instalar enDI con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![Instalar enDI con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -5,7 +5,7 @@
# YunoHost 上的 enDI # YunoHost 上的 enDI
[![集成程度](https://dash.yunohost.org/integration/endi.svg)](https://dash.yunohost.org/appci/app/endi) ![工作状态](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg) [![集成程度](https://dash.yunohost.org/integration/endi.svg)](https://ci-apps.yunohost.org/ci/apps/endi/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/endi.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/endi.maintain.svg)
[![使用 YunoHost 安装 enDI](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi) [![使用 YunoHost 安装 enDI](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=endi)

View file

@ -22,23 +22,13 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================

View file

@ -37,12 +37,6 @@ __ynh_endi_patch_src
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -67,14 +61,6 @@ mkdir "/var/log/$app"
chown -R "$app:$app" "/var/log/$app" chown -R "$app:$app" "/var/log/$app"
chmod 750 "/var/log/$app" chmod 750 "/var/log/$app"
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config
ynh_add_systemd_config
#================================================= #=================================================
# SETUP APPLICATION # SETUP APPLICATION
#================================================= #=================================================
@ -90,14 +76,14 @@ __ynh_endi_add_admin
#================================================= #=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1 ynh_script_progression --message="Configuring log rotation..." --weight=1
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "$app" --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log" yunohost service add "$app" --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log"
#================================================= #=================================================

View file

@ -22,41 +22,14 @@ then
yunohost service remove "$app" yunohost service remove "$app"
fi fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
ynh_remove_systemd_config ynh_remove_systemd_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
ynh_remove_logrotate ynh_remove_logrotate
#=================================================
# REMOVE THE REDIS DATABASE
#=================================================
ynh_script_progression --message="Removing the Redis database..." --weight=1
ynh_redis_remove_db "$redis_db" ynh_redis_remove_db "$redis_db"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing log files..." --weight=1
ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/var/log/$app"
#================================================= #=================================================

View file

@ -20,13 +20,6 @@ ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
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"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
@ -39,21 +32,13 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log" yunohost service add $app --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log"
#================================================= #=================================================

View file

@ -9,12 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -24,30 +18,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/logfile.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/logfile.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
ynh_add_nginx_config
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1
if [ "$upgrade_type" == "UPGRADE_APP" ] # Download, check integrity, uncompress and patch the source from app.src
then ynh_setup_source --dest_dir="$install_dir/endi"
ynh_script_progression --message="Upgrading source files..." --weight=1 __ynh_endi_patch_src
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/endi"
__ynh_endi_patch_src
fi
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -76,24 +54,14 @@ __ynh_endi_migratedb
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
ynh_add_nginx_config
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log" yunohost service add $app --description="enDI, logiciel de comptabilité pour CAE" --log="/var/log/$app/$app.log"
#================================================= #=================================================