From 86692ea7d40e7438798bb9b0fc2a3cf742f4a9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 19 Nov 2020 15:21:22 +0100 Subject: [PATCH] Testing (#11) * Fix check_process warning --- README.md | 3 +-- README_fr.md | 3 +-- check_process | 9 --------- conf/app.src | 2 +- manifest.json | 4 ++-- scripts/backup | 13 +++++++------ scripts/change_url | 17 ++++++++--------- scripts/install | 7 +++---- scripts/remove | 6 +++--- scripts/restore | 5 ++--- scripts/upgrade | 16 ++++------------ 11 files changed, 32 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 8c42d2f..136fbbe 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,7 @@ Clone of 2048 game. You need to reach 243. --- -Developers info ----------------- +## Developers info Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/243_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md index ffabf3f..a1b39df 100644 --- a/README_fr.md +++ b/README_fr.md @@ -33,8 +33,7 @@ Clone du jeu 2048. Il vous faut atteindre 243. --- -Informations pour les développeurs ----------------- +## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/243_ynh/tree/testing). diff --git a/check_process b/check_process index 963a84a..9dbf9e8 100644 --- a/check_process +++ b/check_process @@ -18,14 +18,5 @@ port_already_use=0 change_url=1 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - Level 4=0 Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 \ No newline at end of file diff --git a/conf/app.src b/conf/app.src index b516e68..ccde34b 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,4 @@ SOURCE_SUM=c7d2052999ae4d2e0c5fd5ff1dd6bfb794b7f2bc5caa63f4fbc5e195509c00b9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=81-gh-pages.tar.gz \ No newline at end of file +SOURCE_FILENAME=81-gh-pages.tar.gz diff --git a/manifest.json b/manifest.json index 4c8e762..f6c051f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "2048 game clone", "fr": "Clone du jeu 2048" }, - "version": "1.0~ynh1", + "version": "1.0~ynh3", "url": "https://github.com/hgentry/81/", "license": "MIT", "maintainer": { @@ -14,7 +14,7 @@ "email": "ericgaspar@free.fr" }, "requirements": { - "yunohost": ">= 3.7.0" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/backup b/scripts/backup index ee32cca..80e4cd6 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,37 +6,38 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." --weight=1 ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up Nginx web server configuration..." --weight=2 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -44,4 +45,4 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 7fcf700..e912667 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,7 +8,6 @@ source /usr/share/yunohost/helpers -# Stop script if errors ynh_abort_if_errors #================================================= @@ -34,7 +33,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=2 +ynh_script_progression --message="Backing up $app before changing its URL (may take a while)..." --weight=2 # Backup the current version of the app ynh_backup_before_upgrade @@ -67,23 +66,23 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating Nginx web server configuration..." --weight=3 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -96,7 +95,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading Nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index c560a3e..e46a53c 100755 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -62,9 +61,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring Nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -87,7 +86,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading Nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 2c06727..2123569 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,7 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 +ynh_script_progression --message="Removing $app main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -31,9 +31,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing Nginx web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= diff --git a/scripts/restore b/scripts/restore index 61703fb..7680bdd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -47,7 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=2 +ynh_script_progression --message="Restoring $app main directory..." --weight=2 ynh_restore_file --origin_path="$final_path" @@ -71,7 +70,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=3 +ynh_script_progression --message="Reloading NGINX web server..." --weight=3 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index a252a5a..10a7628 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3 +ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=3 # Backup the current version of the app ynh_backup_before_upgrade @@ -81,9 +81,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -93,18 +93,10 @@ ynh_add_nginx_config # Set permissions on app files chown -R root: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary or protect it -[ $is_public -eq 0 ] || ynh_permission_update --permission "main" --add "visitors" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload