From bf7f8d84373fcbee4708a189bc6d077984edd5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:37:24 +0100 Subject: [PATCH 1/3] Update upgrade --- scripts/upgrade | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 051c77b..26c71c2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,14 +25,9 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=2 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=2 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="app/inc/config.php" -fi +ynh_setup_source --dest_dir="$install_dir" --keep="app/inc/config.php" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -53,15 +48,12 @@ ynh_add_nginx_config #================================================= # UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=2 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Updating a configuration file..." --weight=2 +ynh_add_config --template="config.php" --destination="$install_dir/app/inc/config.php" - ynh_add_config --template="config.php" --destination="$install_dir/app/inc/config.php" - chmod 400 "$install_dir/app/inc/config.php" - chown $app:$app "$install_dir/app/inc/config.php" -fi +chmod 400 "$install_dir/app/inc/config.php" +chown $app:$app "$install_dir/app/inc/config.php" #================================================= # REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE) From 634e67a8ffe6bbeb849682a36f8ecf84c767b99c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 17 Feb 2024 14:37:30 +0000 Subject: [PATCH 2/3] Auto-update README --- README.md | 4 ++-- README_fr.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 72a8993..e2d7d6d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -47,4 +47,4 @@ or sudo yunohost app upgrade opensondage -u https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug ``` -**More info regarding app packaging:** +**More info regarding app packaging:** \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 6e7eda8..f29329b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,5 +1,5 @@ From 9c6adec34e2d6ea727a8b80d6575abea268bc0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:38:20 +0100 Subject: [PATCH 3/3] Update upgrade --- scripts/upgrade | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 26c71c2..87b8d5e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,12 +16,6 @@ source /usr/share/yunohost/helpers email=$(ynh_user_get_info --username=$admin --key=mail) timezone="$(cat /etc/timezone)" -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -37,10 +31,8 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 -# Create a dedicated PHP-FPM config ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -70,16 +62,11 @@ touch "$install_dir/admin/stdout.log" #================================================= # RUN DATABASE UPGRADE #================================================= +ynh_script_progression --message="Upgrading database..." --weight=2 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading database..." --weight=2 +ynh_install_composer - # Install composer - ynh_install_composer - - ynh_exec_warn_less php$phpversion "$install_dir/admin/migration.php" -fi +ynh_exec_warn_less php$phpversion "$install_dir/admin/migration.php" chown -R $app: "$install_dir/"{tpl_c,admin/stdout.log}