From 9a5281a19470f369304fde31ff9b4eada9939442 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 18 Mar 2020 02:06:30 +0100 Subject: [PATCH 01/19] Upgrading to PHP7.3 Fix #20 --- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- scripts/_common.sh | 2 +- scripts/backup | 2 +- scripts/install | 24 ++++++++++++++---------- scripts/restore | 16 +++++++++++++--- scripts/upgrade | 27 ++++++++++++++++++++------- 7 files changed, 51 insertions(+), 24 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 93d374c..dd58121 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -58,7 +58,7 @@ location __PATH__/ { location ~ '[^/]\.php$|^/update.php' { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.2-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index a7b230f..4b682a3 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.2-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php7.3-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4ef113c..e03392b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="curl" -extra_pkg_dependencies="php7.2-fpm php7.2-cli php7.2-gd php7.2-mysql php7.2-xml php7.2-ldap php7.2-mbstring php7.2-json php7.2-simplexml php7.2-curl" +extra_pkg_dependencies="php7.3-fpm php7.3-cli php7.3-gd php7.3-mysql php7.3-xml php7.3-ldap php7.3-mbstring php7.3-json php7.3-simplexml php7.3-curl" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 015da10..688b099 100644 --- a/scripts/backup +++ b/scripts/backup @@ -53,7 +53,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.2/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/7.3/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/install b/scripts/install index 333658b..83f250f 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,17 @@ ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil #================================================= # STANDARD MODIFICATIONS +#================================================= +# INSTALL PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "stretch" ]; then + ynh_print_info --message="Installing PHP7.3..." + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" +else + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -72,13 +83,6 @@ 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" - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -147,7 +151,7 @@ mkdir -p "$final_path/.composer" cp -f "../conf/composer.json" "$final_path/composer.json" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/composer.json" -ynh_install_composer --phpversion="7.2" --workdir="$final_path" +ynh_install_composer --phpversion="7.3" --workdir="$final_path" export PATH="$final_path/vendor/bin:$PATH" @@ -159,7 +163,7 @@ ynh_print_info --message="Installing Drupal..." chown -R $app: $final_path pushd "$final_path" - update-alternatives --set php /usr/bin/php7.2 + update-alternatives --set php /usr/bin/php7.3 sudo -u $app env PATH=$PATH drush site:install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes update-alternatives --set php /usr/bin/php7.0 popd @@ -190,7 +194,7 @@ ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" ynh_print_info --message="Configuring php-fpm..." # Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" +ynh_add_fpm_config --phpversion="7.3" #================================================= # SECURE FILES AND DIRECTORIES diff --git a/scripts/restore b/scripts/restore index 530ab41..7ba1dce 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,6 +81,17 @@ chown -R $app: $final_path #================================================= # SPECIFIC RESTORATION +#================================================= +# REINSTALL PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "stretch" ]; then + ynh_print_info --message="Reinstalling PHP7.3..." + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" +else + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +fi + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -88,7 +99,6 @@ ynh_print_info --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= # RESTORE THE MYSQL DATABASE @@ -104,7 +114,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_print_info --message="Restoring PHP-FPM configuration..." -ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/7.3/fpm/pool.d/$app.conf" #================================================= # RESTORE THE CRON FILE @@ -126,7 +136,7 @@ ynh_add_swap --size=512 #================================================= ynh_print_info --message="Reloading nginx web server and php-fpm..." -ynh_systemd_action --service_name=php7.2-fpm --action=reload +ynh_systemd_action --service_name=php7.3-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f5b73af..b762675 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,13 +85,23 @@ ynh_print_info --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config +#================================================= +# UPGRADE PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "stretch" ]; then + ynh_print_info --message="Upgrading PHP7.3..." + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" +else + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +fi + #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_print_info --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= # CREATE DEDICATED USER @@ -106,8 +116,11 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_print_info --message="Upgrading php-fpm configuration..." +# Remove the dedicated php-fpm config +ynh_remove_fpm_config + # Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" +ynh_add_fpm_config --phpversion="7.3" #================================================= # SPECIFIC UPGRADE @@ -123,8 +136,8 @@ ynh_add_swap --size=512 #================================================= ynh_print_info --message="Upgrading Composer..." -update-alternatives --set php /usr/bin/php7.2 -ynh_install_composer --phpversion="7.2" --workdir="$final_path" +update-alternatives --set php /usr/bin/php7.3 +ynh_install_composer --phpversion="7.3" --workdir="$final_path" update-alternatives --set php /usr/bin/php7.0 #================================================= @@ -142,10 +155,10 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update pushd "$final_path" - update-alternatives --set php /usr/bin/php7.2 + update-alternatives --set php /usr/bin/php7.3 sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer - sudo -u $app env PATH=$PATH php7.2 composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies - sudo -u $app env PATH=$PATH php7.2 composer.phar update --with-dependencies + sudo -u $app env PATH=$PATH php7.3 composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies + sudo -u $app env PATH=$PATH php7.3 composer.phar update --with-dependencies sudo -u $app env PATH=$PATH drush @$app.prod -y updatedb sudo -u $app env PATH=$PATH drush @$app.prod cache:rebuild sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 0 --input-format=integer From 0435fdaeb0a3aa5344b535025370a1dcf6feb322 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 20 Mar 2020 13:03:16 +0100 Subject: [PATCH 02/19] fix upgrade --- scripts/upgrade | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b762675..40dabdc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,9 +116,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_print_info --message="Upgrading php-fpm configuration..." -# Remove the dedicated php-fpm config -ynh_remove_fpm_config - # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.3" From f8257534506ecee44c4d6a84ab332bd7c7be767d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 20 Mar 2020 13:07:13 +0100 Subject: [PATCH 03/19] add upgrade checks informations --- check_process | 1 + 1 file changed, 1 insertion(+) diff --git a/check_process b/check_process index 27e721c..bebc18e 100644 --- a/check_process +++ b/check_process @@ -15,6 +15,7 @@ setup_private=1 setup_public=1 upgrade=1 + # 8.7.1 upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 backup_restore=1 multi_instance=1 From 0b9b2130b4843c76a3970aeb5f352c24ee296b1e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 22 Mar 2020 18:46:53 +0100 Subject: [PATCH 04/19] Typo --- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 83f250f..2288499 100644 --- a/scripts/install +++ b/scripts/install @@ -121,7 +121,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # SPECIFIC SETUP #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." diff --git a/scripts/remove b/scripts/remove index d20c553..b63c2b9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -69,7 +69,7 @@ ynh_print_info --message="Removing nginx web server configuration..." ynh_remove_nginx_config #================================================= -# REMOVE SWAPP +# REMOVE SWAP #================================================= ynh_print_info --message="Removing swap..." diff --git a/scripts/restore b/scripts/restore index 7ba1dce..62d0cef 100644 --- a/scripts/restore +++ b/scripts/restore @@ -123,7 +123,7 @@ ynh_restore_file --origin_path="/etc/php/7.3/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." diff --git a/scripts/upgrade b/scripts/upgrade index 40dabdc..1099f86 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,7 +122,7 @@ ynh_add_fpm_config --phpversion="7.3" #================================================= # SPECIFIC UPGRADE #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." From baa5d5efee79f98e0147d3eeaae7760d52b63ebd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 23 Mar 2020 19:25:55 +0100 Subject: [PATCH 05/19] Fixing update --- scripts/upgrade | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1099f86..039a3cd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,8 +90,13 @@ ynh_add_nginx_config #================================================= if [ "$(lsb_release --codename --short)" = "stretch" ]; then - ynh_print_info --message="Upgrading PHP7.3..." - ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" + if [ "$(ynh_app_setting_get --app=$app --key=php_version)" != "7.3" ]; then + ynh_print_info --message="Upgrading PHP7.3..." + ynh_remove_fpm_config + ynh_remove_app_dependencies + ynh_remove_php + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" + fi else pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" fi From 8715a53b1cdf83a31d721b49ac0172d52d236248 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 23 Mar 2020 19:46:23 +0100 Subject: [PATCH 06/19] upgrade version number --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3871c8d..307dc7f 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 Free and open-source content management framework. -**Shipped version:** 8.8.1 +**Shipped version:** 8.8.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 0fb7e87..11c0fc2 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 Framework de gestion de contenu libre et open-source. -**Version incluse:** 8.8.1 +**Version incluse:** 8.8.4 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 55c630f..cd5f170 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A content management framework written in PHP", "fr": "Un système de gestion de contenu écrit en PHP" }, - "version": "8.8.1~ynh1", + "version": "8.8.4~ynh1", "url": "https://www.drupal.org", "license": "GPL-2.0-or-later", "maintainer": { From c89fd73e649714e33b31846ecc3bdfc17c6eefe7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 24 Mar 2020 19:43:26 +0100 Subject: [PATCH 07/19] github rate limit workaround --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 039a3cd..436ca41 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -156,6 +156,11 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update-refresh #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update +# Bypass composer issue and GitHub Rate Limit +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + sleep 3600 +fi + pushd "$final_path" update-alternatives --set php /usr/bin/php7.3 sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer From e6ed8d21a08f4c689458715f6d780f3311f0cc98 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 24 Mar 2020 19:45:11 +0100 Subject: [PATCH 08/19] adding link --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 436ca41..ef21b59 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -156,7 +156,7 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update-refresh #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update -# Bypass composer issue and GitHub Rate Limit +# Bypass composer issue and GitHub Rate Limit https://developer.github.com/v3/#rate-limiting if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 3600 fi From 044a29a9aba15348ca8525c04f14a457403facef Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 24 Mar 2020 19:59:28 +0100 Subject: [PATCH 09/19] reorder dependencies between stretch and buster --- scripts/install | 6 +++--- scripts/restore | 6 +++--- scripts/upgrade | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 2288499..32704ba 100644 --- a/scripts/install +++ b/scripts/install @@ -69,11 +69,11 @@ ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil # INSTALL PHP7.3 #================================================= -if [ "$(lsb_release --codename --short)" = "stretch" ]; then +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else ynh_print_info --message="Installing PHP7.3..." ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" -else - pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" fi #================================================= diff --git a/scripts/restore b/scripts/restore index 62d0cef..ef098fa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,11 +85,11 @@ chown -R $app: $final_path # REINSTALL PHP7.3 #================================================= -if [ "$(lsb_release --codename --short)" = "stretch" ]; then +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else ynh_print_info --message="Reinstalling PHP7.3..." ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" -else - pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ef21b59..6abbdea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,7 +89,9 @@ ynh_add_nginx_config # UPGRADE PHP7.3 #================================================= -if [ "$(lsb_release --codename --short)" = "stretch" ]; then +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else if [ "$(ynh_app_setting_get --app=$app --key=php_version)" != "7.3" ]; then ynh_print_info --message="Upgrading PHP7.3..." ynh_remove_fpm_config @@ -97,8 +99,6 @@ if [ "$(lsb_release --codename --short)" = "stretch" ]; then ynh_remove_php ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" fi -else - pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" fi #================================================= From 9b94017a62c33085fc1179791f2f5ab8859267cb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 25 Mar 2020 10:02:49 +0100 Subject: [PATCH 10/19] Manage swap for package_check --- scripts/install | 5 ++++- scripts/remove | 5 ++++- scripts/restore | 5 ++++- scripts/upgrade | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 32704ba..0929f8c 100644 --- a/scripts/install +++ b/scripts/install @@ -125,7 +125,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_print_info --message="Adding swap..." -ynh_add_swap --size=512 +# Don't create swap during package_check +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=512 +fi #================================================= # CREATE DRUSH ALIAS diff --git a/scripts/remove b/scripts/remove index b63c2b9..1bd5870 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,7 +73,10 @@ ynh_remove_nginx_config #================================================= ynh_print_info --message="Removing swap..." -ynh_del_swap +# Don't delete not existing swap during package_check +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_del_swap +fi #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index ef098fa..5b915bd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -127,7 +127,10 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_print_info --message="Adding swap..." -ynh_add_swap --size=512 +# Don't create swap during package_check +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=512 +fi #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6abbdea..8b4c73f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -131,7 +131,10 @@ ynh_add_fpm_config --phpversion="7.3" #================================================= ynh_print_info --message="Adding swap..." -ynh_add_swap --size=512 +# Don't create swap during package_check +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + ynh_add_swap --size=512 +fi #================================================= # UPGRADE COMPOSER From edf3c64bd808430d874a97e53160726ad881adde Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 25 Mar 2020 11:25:44 +0100 Subject: [PATCH 11/19] Update composer.json --- conf/composer.json | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/conf/composer.json b/conf/composer.json index e78f2a7..014c3df 100644 --- a/conf/composer.json +++ b/conf/composer.json @@ -16,20 +16,19 @@ } ], "require": { - "php": ">=5.6", + "php": ">=7.0.8", "composer/installers": "^1.2", "cweagans/composer-patches": "^1.6.5", - "drupal-composer/drupal-scaffold": "^2.5", "drupal/console": "^1.0.2", - "drupal/core": "^8.7.0", - "drush/drush": "^9.0.0", - "vlucas/phpdotenv": "^2.4", + "drupal/core": "^8.8.0", + "drupal/core-composer-scaffold": "^8.8.0", + "drush/drush": "^9.7.1 | ^10.0.0", + "vlucas/phpdotenv": "^4.0", "webflo/drupal-finder": "^1.0.0", - "webmozart/path-util": "^2.3", "zaporylie/composer-drupal-optimizations": "^1.0" }, "require-dev": { - "webflo/drupal-core-require-dev": "^8.7.0" + "drupal/core-dev": "^8.8.0" }, "conflict": { "drupal/drupal": "*" @@ -64,19 +63,18 @@ "patchLevel": { "drupal/core": "-p2" }, + "drupal-scaffold": { + "locations": { + "web-root": "__APP__/" + } + }, "installer-paths": { "__APP__/core": ["type:drupal-core"], "__APP__/libraries/{$name}": ["type:drupal-library"], "__APP__/modules/contrib/{$name}": ["type:drupal-module"], "__APP__/profiles/contrib/{$name}": ["type:drupal-profile"], "__APP__/themes/contrib/{$name}": ["type:drupal-theme"], - "drush/Commands/{$name}": ["type:drupal-drush"] - }, - "drupal-scaffold": { - "initial": { - ".editorconfig": "../.editorconfig", - ".gitattributes": "../.gitattributes" - } + "drush/Commands/contrib/{$name}": ["type:drupal-drush"] } } } From cf5dcb6aa247596e4d906e2e8bb88d2ecf2b5102 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 25 Mar 2020 11:27:12 +0100 Subject: [PATCH 12/19] removing package_check upgrade from previous version --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index bebc18e..5050ccd 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ setup_public=1 upgrade=1 # 8.7.1 - upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 + # upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. From c363f8aa11adde8ea663376bb06974d1fe09dfc1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 25 Mar 2020 12:02:48 +0100 Subject: [PATCH 13/19] Rollbacking composer.json --- conf/composer.json | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/conf/composer.json b/conf/composer.json index 014c3df..e78f2a7 100644 --- a/conf/composer.json +++ b/conf/composer.json @@ -16,19 +16,20 @@ } ], "require": { - "php": ">=7.0.8", + "php": ">=5.6", "composer/installers": "^1.2", "cweagans/composer-patches": "^1.6.5", + "drupal-composer/drupal-scaffold": "^2.5", "drupal/console": "^1.0.2", - "drupal/core": "^8.8.0", - "drupal/core-composer-scaffold": "^8.8.0", - "drush/drush": "^9.7.1 | ^10.0.0", - "vlucas/phpdotenv": "^4.0", + "drupal/core": "^8.7.0", + "drush/drush": "^9.0.0", + "vlucas/phpdotenv": "^2.4", "webflo/drupal-finder": "^1.0.0", + "webmozart/path-util": "^2.3", "zaporylie/composer-drupal-optimizations": "^1.0" }, "require-dev": { - "drupal/core-dev": "^8.8.0" + "webflo/drupal-core-require-dev": "^8.7.0" }, "conflict": { "drupal/drupal": "*" @@ -63,18 +64,19 @@ "patchLevel": { "drupal/core": "-p2" }, - "drupal-scaffold": { - "locations": { - "web-root": "__APP__/" - } - }, "installer-paths": { "__APP__/core": ["type:drupal-core"], "__APP__/libraries/{$name}": ["type:drupal-library"], "__APP__/modules/contrib/{$name}": ["type:drupal-module"], "__APP__/profiles/contrib/{$name}": ["type:drupal-profile"], "__APP__/themes/contrib/{$name}": ["type:drupal-theme"], - "drush/Commands/contrib/{$name}": ["type:drupal-drush"] + "drush/Commands/{$name}": ["type:drupal-drush"] + }, + "drupal-scaffold": { + "initial": { + ".editorconfig": "../.editorconfig", + ".gitattributes": "../.gitattributes" + } } } } From 9c0f01e0121d1e51fa4249bd836758af208d4548 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 25 Mar 2020 19:58:57 +0100 Subject: [PATCH 14/19] rollback swap removal for package_check --- scripts/install | 5 +---- scripts/remove | 5 +---- scripts/restore | 5 +---- scripts/upgrade | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index 0929f8c..32704ba 100644 --- a/scripts/install +++ b/scripts/install @@ -125,10 +125,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_print_info --message="Adding swap..." -# Don't create swap during package_check -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then - ynh_add_swap --size=512 -fi +ynh_add_swap --size=512 #================================================= # CREATE DRUSH ALIAS diff --git a/scripts/remove b/scripts/remove index 1bd5870..b63c2b9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,10 +73,7 @@ ynh_remove_nginx_config #================================================= ynh_print_info --message="Removing swap..." -# Don't delete not existing swap during package_check -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then - ynh_del_swap -fi +ynh_del_swap #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index 5b915bd..ef098fa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -127,10 +127,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_print_info --message="Adding swap..." -# Don't create swap during package_check -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then - ynh_add_swap --size=512 -fi +ynh_add_swap --size=512 #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 8b4c73f..6abbdea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -131,10 +131,7 @@ ynh_add_fpm_config --phpversion="7.3" #================================================= ynh_print_info --message="Adding swap..." -# Don't create swap during package_check -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then - ynh_add_swap --size=512 -fi +ynh_add_swap --size=512 #================================================= # UPGRADE COMPOSER From 9700603b8661f92eaf7548046b363657c057fe7d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 26 Mar 2020 22:29:23 +0100 Subject: [PATCH 15/19] without sleep during upgrade --- scripts/upgrade | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6abbdea..25dcd07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -156,11 +156,6 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update-refresh #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update -# Bypass composer issue and GitHub Rate Limit https://developer.github.com/v3/#rate-limiting -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - sleep 3600 -fi - pushd "$final_path" update-alternatives --set php /usr/bin/php7.3 sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer From 2afcccf2272a250c6679d726aa6fe5d5cbe23835 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 27 Mar 2020 14:54:30 +0100 Subject: [PATCH 16/19] only remove php if not buster --- scripts/remove | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index b63c2b9..72ae7e5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,7 +50,9 @@ ynh_print_info --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_remove_php +if [ "$(lsb_release --codename --short)" != "buster" ]; then + ynh_remove_php +fi #================================================= # REMOVE APP MAIN DIR From 33a1198801bd53048be8f33b917ebd8e1492a896 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 28 Mar 2020 21:04:33 +0100 Subject: [PATCH 17/19] reorder --- scripts/change_url | 4 ++-- scripts/install | 12 +++++++----- scripts/remove | 11 ++++++++--- scripts/upgrade | 12 ++++++++---- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index b8abe7f..23c96ae 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -110,8 +110,8 @@ cp -f "../conf/example.site.yml" "$final_path/drush/sites/$app.site.yml" ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/drush/sites/$app.site.yml" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$final_path/drush/sites/$app.site.yml" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 32704ba..4b77c30 100644 --- a/scripts/install +++ b/scripts/install @@ -162,16 +162,18 @@ ynh_print_info --message="Installing Drupal..." chown -R $app: $final_path -pushd "$final_path" - update-alternatives --set php /usr/bin/php7.3 +update-alternatives --set php /usr/bin/php7.3 + +pushd "$final_path" sudo -u $app env PATH=$PATH drush site:install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes - update-alternatives --set php /usr/bin/php7.0 popd +update-alternatives --set php /usr/bin/php7.0 + #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file..." +ynh_print_info --message="Setuping the cron file..." cp ../conf/cron /etc/cron.d/$app diff --git a/scripts/remove b/scripts/remove index 72ae7e5..cc6e46e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -43,6 +43,14 @@ ynh_print_info --message="Removing php-fpm configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config +#================================================= +# REMOVE PHP +#================================================= + +if [ "$(lsb_release --codename --short)" != "buster" ]; then + ynh_print_info --message="Removing php..." + ynh_remove_php +fi #================================================= # REMOVE DEPENDENCIES #================================================= @@ -50,9 +58,6 @@ ynh_print_info --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -if [ "$(lsb_release --codename --short)" != "buster" ]; then - ynh_remove_php -fi #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index 25dcd07..4de149f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,6 +98,8 @@ else ynh_remove_app_dependencies ynh_remove_php ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" + else + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" fi fi @@ -156,17 +158,19 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update-refresh #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update +update-alternatives --set php /usr/bin/php7.3 + pushd "$final_path" - update-alternatives --set php /usr/bin/php7.3 sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer sudo -u $app env PATH=$PATH php7.3 composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies sudo -u $app env PATH=$PATH php7.3 composer.phar update --with-dependencies sudo -u $app env PATH=$PATH drush @$app.prod -y updatedb sudo -u $app env PATH=$PATH drush @$app.prod cache:rebuild sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 0 --input-format=integer - update-alternatives --set php /usr/bin/php7.0 popd +update-alternatives --set php /usr/bin/php7.0 + #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= @@ -176,9 +180,9 @@ ynh_print_info --message="Storing the config file checksum..." ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file" +ynh_print_info --message="Setuping the cron file" cp -f ../conf/cron /etc/cron.d/$app From 00e59214718a49553af53c6d43b8c6cc8e0cb562 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 28 Mar 2020 21:48:50 +0100 Subject: [PATCH 18/19] factorisation --- scripts/change_url | 11 ++++++----- scripts/install | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 23c96ae..aef7dc5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -106,12 +106,13 @@ fi #================================================= ynh_print_info --message="Updating Drush alias..." -cp -f "../conf/example.site.yml" "$final_path/drush/sites/$app.site.yml" +drush_aliasconfig="$final_path/drush/sites/$app.site.yml" +cp -f "../conf/example.site.yml" "$drush_aliasconfig" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$drush_aliasconfig" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 4b77c30..00bb993 100644 --- a/scripts/install +++ b/scripts/install @@ -133,13 +133,13 @@ ynh_add_swap --size=512 ynh_print_info --message="Creating Drush alias..." mkdir -p "$final_path/drush/sites/" +drush_aliasconfig="$final_path/drush/sites/$app.site.yml" +cp -f "../conf/example.site.yml" "$drush_aliasconfig" -cp -f "../conf/example.site.yml" "$final_path/drush/sites/$app.site.yml" - -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$drush_aliasconfig" #================================================= # INSTALL COMPOSER From e1f911ff0983ee3e30c5abf958ecb71a99e3149d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 29 Mar 2020 16:43:12 +0200 Subject: [PATCH 19/19] Removing not needed port --- scripts/remove | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index cc6e46e..79d2db6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,7 +20,6 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path)