From 15d29571e5bdba421b9953b535670fd2f8311177 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 00:33:47 +0200 Subject: [PATCH 1/8] Update cron --- conf/cron | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/conf/cron b/conf/cron index 41d21c6..a53d8c3 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,13 @@ -H * * * * __APP__ /usr/bin/env PATH=__FINALPATH__/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 drush --quiet @__APP__ core-cron -0 22 * * * __APP__ /usr/bin/env PATH=__FINALPATH__/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 drush --quiet @__APP__ pm-update -y \ No newline at end of file +# /etc/crontab: system-wide crontab +# Unlike any other crontab you don't have to run the `crontab' +# command to install the new version when you edit this file +# and files in /etc/cron.d. These files also have username fields, +# that none of the other crontabs do. + +SHELL=/bin/sh +PATH=__FINALPATH__/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +# m h dom mon dow user command +30 * * * * __APP__ drush --quiet @__APP__ core-cron +00 22 * * * __APP__ drush --quiet @__APP__ pm-update -y +# From 0fa11731f5c895f9e2ac31e85078eb2db6c44a31 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 00:33:54 +0200 Subject: [PATCH 2/8] Update upgrade --- scripts/upgrade | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index b38b194..eb11fdd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,6 +147,16 @@ ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/setti # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" +#================================================= +# SET THE CRON FILE +#================================================= +ynh_print_info --message="Set the cron file" + +cp -f ../conf/cron /etc/cron.d/$app + +ynh_replace_string "__FINALPATH__" "$final_path" /etc/cron.d/$app +ynh_replace_string "__APP__" "$app" /etc/cron.d/$app + #================================================= # GENERIC FINALIZATION #================================================= From 7a970209e3270bbf56ac5a4834ea6e2bbcef3d54 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 00:34:07 +0200 Subject: [PATCH 3/8] update to 5.13.2 --- README.md | 2 +- README_fr.md | 2 +- conf/civicrm-drupal.src | 4 ++-- conf/civicrm-l10n.src | 4 ++-- manifest.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9d21ccb..8f51476 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Open source constituent relationship management (CRM) for non-profits, NGOs and advocacy organizations. -**Shipped version:** 5.12.4 on Drupal 7 +**Shipped version:** 5.13.2 on Drupal 7 ## Screenshots diff --git a/README_fr.md b/README_fr.md index e88d616..b9d7709 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble Gestion des relations avec les constituants (GRC/CRM) pour les organisations à but non lucratif, les ONG et les organisations de défense des droits. -**Version incluse:** 5.12.4 et Drupal 7 +**Version incluse:** 5.13.2 et Drupal 7 ## Captures d'écran diff --git a/conf/civicrm-drupal.src b/conf/civicrm-drupal.src index c2dbb27..5623fb6 100644 --- a/conf/civicrm-drupal.src +++ b/conf/civicrm-drupal.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.12.4/civicrm-5.12.4-drupal.tar.gz -SOURCE_SUM=9f85aa5ed03c9da2c1698bd4ce64dc1485736206c56acd47d1933a0777c3be44 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.13.2/civicrm-5.13.2-drupal.tar.gz +SOURCE_SUM=ba626e3441e4bd6875a91b34ff5ae7979eab7d93ab4893c5185ae3304e7347ad SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/civicrm-l10n.src b/conf/civicrm-l10n.src index e08e300..9cfda51 100644 --- a/conf/civicrm-l10n.src +++ b/conf/civicrm-l10n.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.12.4/civicrm-5.12.4-l10n.tar.gz -SOURCE_SUM=ce3063a2151364b3f020327a5e3596b9708d06b4e03bc645ed4ef38216ca6fe6 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.13.2/civicrm-5.13.2-l10n.tar.gz +SOURCE_SUM=9e4ac9e89e44c7b8afd02c2f82f6fe0c21ecb0504ad4f81e08b1109dd60b9dc2 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 238c9c7..631f5f5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "CRM for non-profits, NGOs and advocacy organizations.", "fr": "CRM pour organisations à but non lucratif et ONG." }, - "version": "5.12.4-7.0~ynh1", + "version": "5.13.2-7.0~ynh1", "url": "https://civicrm.org", "license": "AGPL-3.0-or-later", "maintainer": { From 8266a519021104bf814ee0bcd838bdedb3ff0322 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 00:34:56 +0200 Subject: [PATCH 4/8] Update cron --- conf/cron | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/cron b/conf/cron index a53d8c3..a008e46 100644 --- a/conf/cron +++ b/conf/cron @@ -1,9 +1,3 @@ -# /etc/crontab: system-wide crontab -# Unlike any other crontab you don't have to run the `crontab' -# command to install the new version when you edit this file -# and files in /etc/cron.d. These files also have username fields, -# that none of the other crontabs do. - SHELL=/bin/sh PATH=__FINALPATH__/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin From 48ba88232338694dfb85a3419a32b18d46365b32 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 01:32:04 +0200 Subject: [PATCH 5/8] Update upgrade --- scripts/upgrade | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index eb11fdd..5e7852a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,15 @@ ynh_add_fpm_config --phpversion="7.2" #================================================= # SPECIFIC UPGRADE +#================================================= +# UPDATE thread_stack +#================================================= +ynh_print_info --message="Updating thread_stack..." + +ynh_replace_string "thread_stack = 128K" "thread_stack = 192K" "/etc/mysql/my.cnf" + +systemctl restart mysql + #================================================= # UPDATE COMPOSER #================================================= @@ -127,7 +136,7 @@ export PATH="$final_path/.composer/vendor/bin:$PATH" sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1 sudo -u $app env PATH=$PATH drush @$app cache-clear all -sudo -u $app env PATH=$PATH drush @$app pm-update drupal +sudo -u $app env PATH=$PATH drush @$app pm-update -y drupal sudo -u $app env PATH=$PATH drush @$app cache-clear all sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh sudo -u $app env PATH=$PATH drush @$app l10n-update @@ -185,6 +194,13 @@ ynh_print_info --message="Reloading nginx web server..." systemctl reload nginx +#================================================= +# RESTART CRON +#================================================= +ynh_print_info --message="Restarting cron..." + +systemctl restart cron + #================================================= # END OF SCRIPT #================================================= From f1e5751364c69c5e99d3cb84ea090899b6865461 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 17 May 2019 03:37:00 +0200 Subject: [PATCH 6/8] Apply example_ynh --- README.md | 8 ++++---- README_fr.md | 6 +++--- scripts/change_url | 11 ++++++----- scripts/install | 48 ++++++++++++++++++++++------------------------ scripts/remove | 12 ++++++------ scripts/restore | 21 ++++++++++---------- scripts/upgrade | 41 ++++++++++++++++----------------------- 7 files changed, 70 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 8f51476..ac5eef6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # CiviCRM on Drupal 7 for YunoHost [![Integration level](https://dash.yunohost.org/integration/civicrm_drupal7.svg)](https://dash.yunohost.org/appci/app/civicrm_drupal7) -[![Install Drupal 7 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=civicrm_drupal7) +[![Install CiviCRM on Drupal 7 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=civicrm_drupal7) *[Lire ce readme en français.](./README_fr.md)* @@ -29,9 +29,9 @@ LDAP module can be installed #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/civicrm_drupal7/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/civicrm_drupal7/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/civicrm_drupal7/) +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/civicrm_drupal7/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/civicrm_drupal7/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/civicrm_drupal7/) ## Links diff --git a/README_fr.md b/README_fr.md index b9d7709..40293d4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,9 +29,9 @@ le module d'authentification LDAP peut être installé #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/civicrm_drupal7/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/civicrm_drupal7/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/civicrm_drupal7%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/civicrm_drupal7/) +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/civicrm_drupal7/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/civicrm_drupal7/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/civicrm_drupal7%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/civicrm_drupal7/) ## Liens diff --git a/scripts/change_url b/scripts/change_url index 0bff0b1..03fabfe 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,6 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#db_user=$db_name #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= @@ -89,10 +90,10 @@ ynh_print_info --message="Updating Drush alias..." cp -f "../conf/yoursite.aliases.drushrc.php" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__FINALPATH__" "$final_path" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__APP__" "$app" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__DOMAIN__" "$new_domain" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__PATH_URL__" "$new_path" "$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" #================================================= # GENERIC FINALISATION @@ -101,7 +102,7 @@ ynh_replace_string "__PATH_URL__" "$new_path" "$final_path/.drush/$app.aliases.d #================================================= ynh_print_info --message="Reloading nginx web server..." -systemctl reload nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 23ca9b5..6e4a410 100644 --- a/scripts/install +++ b/scripts/install @@ -41,7 +41,7 @@ app=$YNH_APP_INSTANCE_NAME ynh_print_info --message="Validating installation parameters..." final_path=/var/www/$app -test ! -e "$final_path" || ynh_die "This path already contains a folder" +test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -73,19 +73,17 @@ ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= ynh_print_info --message="Creating a MySQL database..." -db_name=$(ynh_sanitize_dbid $app) +db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE +# CREATE FINAL PATH #================================================= -ynh_print_info --message="Setting up source files..." +ynh_print_info --message="Creating final path..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src - mkdir -p "$final_path" #================================================= @@ -104,6 +102,14 @@ ynh_print_info --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_print_info --message="Configuring php-fpm..." + +# Create a dedicated php-fpm config +ynh_add_fpm_config --phpversion="7.2" + #================================================= # SPECIFIC SETUP #================================================= @@ -115,10 +121,10 @@ mkdir -p "$final_path/.drush" cp -f "../conf/yoursite.aliases.drushrc.php" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__FINALPATH__" "$final_path" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__APP__" "$app" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__DOMAIN__" "$domain" "$final_path/.drush/$app.aliases.drushrc.php" -ynh_replace_string "__PATH_URL__" "$path_url" "$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.drush/$app.aliases.drushrc.php" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/.drush/$app.aliases.drushrc.php" #================================================= # INSTALL COMPOSER @@ -134,9 +140,9 @@ ynh_install_composer --phpversion="7.2" --workdir="$final_path/.composer" export PATH="$final_path/.composer/vendor/bin:$PATH" #================================================= -# INSTALL DRUPAL +# INSTALL DRUPAL AND CIVICRM #================================================= -ynh_print_info --message="Installing Drupal..." +ynh_print_info --message="Installing Drupal and CiviCRM..." chown -R $app: $final_path @@ -167,22 +173,14 @@ chmod 755 $final_path/$app/sites/default/ sudo -u $app env PATH=$PATH drush --include="$final_path/$app/sites/all/modules/civicrm/drupal/drush" @$app civicrm-install --dbhost="localhost" --dbname="$db_name" --dbpass="$db_pwd" --dbuser="$db_user" --destination="sites/all/modules" --site_url="$domain$path_url" --ssl=on #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Set the cron file" +ynh_print_info --message="Setuping the cron file..." cp ../conf/cron /etc/cron.d/$app -ynh_replace_string "__FINALPATH__" "$final_path" /etc/cron.d/$app -ynh_replace_string "__APP__" "$app" /etc/cron.d/$app - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_print_info --message="Configuring php-fpm..." - -# Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -217,7 +215,7 @@ fi #================================================= ynh_print_info --message="Reloading nginx web server..." -systemctl reload nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 00d5d58..e621e6d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Removing the MySQL database" +ynh_print_info --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -37,7 +37,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Removing php-fpm configuration" +ynh_print_info --message="Removing php-fpm configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -45,7 +45,7 @@ ynh_remove_fpm_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies" +ynh_print_info --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -54,7 +54,7 @@ ynh_remove_php #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory" +ynh_print_info --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -62,7 +62,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration" +ynh_print_info --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -81,7 +81,7 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_print_info --message="Removing the dedicated system user" +ynh_print_info --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app diff --git a/scripts/restore b/scripts/restore index f7763d5..3492801 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -71,12 +72,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # Restore permissions on app files chown -R $app: $final_path -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -94,8 +89,14 @@ ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" ynh_print_info --message="Restoring the MySQL database..." db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= + +ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" #================================================= # RESTORE THE CRON FILE @@ -110,8 +111,8 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_print_info --message="Reloading nginx web server and php-fpm..." -systemctl reload php7.2-fpm -systemctl reload nginx +ynh_systemd_action --service_name=php7.2-fpm --action=reload +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 5e7852a..d23d90b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -42,13 +48,13 @@ elif [ "$is_public" = "No" ]; then fi # If db_name doesn't exist, create it -if [ -z $db_name ]; then +if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi # If final_path doesn't exist, create it -if [ -z $final_path ]; then +if [ -z "$final_path" ]; then final_path=/var/www/$app ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi @@ -69,14 +75,6 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= -ynh_print_info --message="Upgrading source files..." - -# Download, check integrity, uncompress and patch the source from app.src -#ynh_setup_source --dest_dir="$final_path" - #================================================= # NGINX CONFIGURATION #================================================= @@ -116,9 +114,9 @@ ynh_add_fpm_config --phpversion="7.2" #================================================= ynh_print_info --message="Updating thread_stack..." -ynh_replace_string "thread_stack = 128K" "thread_stack = 192K" "/etc/mysql/my.cnf" +ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="/etc/mysql/my.cnf" -systemctl restart mysql +ynh_systemd_action --service_name=mysql --action="restart" #================================================= # UPDATE COMPOSER @@ -157,14 +155,16 @@ ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/setti ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Set the cron file" +ynh_print_info --message="Setuping the cron file" cp -f ../conf/cron /etc/cron.d/$app -ynh_replace_string "__FINALPATH__" "$final_path" /etc/cron.d/$app -ynh_replace_string "__APP__" "$app" /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" + +ynh_systemd_action --service_name=cron --action=reload #================================================= # GENERIC FINALIZATION @@ -192,14 +192,7 @@ fi #================================================= ynh_print_info --message="Reloading nginx web server..." -systemctl reload nginx - -#================================================= -# RESTART CRON -#================================================= -ynh_print_info --message="Restarting cron..." - -systemctl restart cron +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From c6a60322045474683d306200a8a5975a84e78431 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 17 May 2019 04:07:24 +0200 Subject: [PATCH 7/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6e4a410..8c3b5c4 100644 --- a/scripts/install +++ b/scripts/install @@ -31,7 +31,7 @@ language=$YNH_APP_ARG_LANGUAGE password=$YNH_APP_ARG_PASSWORD install_profil=$YNH_APP_ARG_INSTALL_PROFIL -admin_mail=$(ynh_user_get_info $admin 'mail') +admin_mail=$(ynh_user_get_info --username=$admin --key="mail") app=$YNH_APP_INSTANCE_NAME From 9fc4033e9a133f0de621b842b417a4ccf6f1be1b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 18 May 2019 05:32:56 +0200 Subject: [PATCH 8/8] Update install --- scripts/install | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 8c3b5c4..5f1f6b6 100644 --- a/scripts/install +++ b/scripts/install @@ -66,6 +66,12 @@ ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil ynh_print_info --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# INSTALL PHP +#================================================= +ynh_print_info --message="Installing PHP..." + ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= @@ -102,14 +108,6 @@ ynh_print_info --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_print_info --message="Configuring php-fpm..." - -# Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" - #================================================= # SPECIFIC SETUP #================================================= @@ -191,6 +189,14 @@ ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" #================================================= # GENERIC FINALIZATION +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_print_info --message="Configuring php-fpm..." + +# Create a dedicated php-fpm config +ynh_add_fpm_config --phpversion="7.2" + #================================================= # SECURE FILES AND DIRECTORIES #=================================================