mirror of
https://github.com/YunoHost-Apps/drupal_ynh.git
synced 2024-09-03 18:35:53 +02:00
commit
97a1615471
12 changed files with 65 additions and 33 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061
|
||||
# 8.7.1
|
||||
# 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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)" = "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"
|
||||
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
|
||||
#=================================================
|
||||
|
@ -117,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..."
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -50,7 +50,9 @@ 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
|
||||
|
@ -69,7 +71,7 @@ ynh_print_info --message="Removing nginx web server configuration..."
|
|||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE SWAPP
|
||||
# REMOVE SWAP
|
||||
#=================================================
|
||||
ynh_print_info --message="Removing swap..."
|
||||
|
||||
|
|
|
@ -81,6 +81,17 @@ chown -R $app: $final_path
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# REINSTALL PHP7.3
|
||||
#=================================================
|
||||
|
||||
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"
|
||||
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
|
||||
|
@ -113,7 +123,7 @@ ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf"
|
|||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# ADD SWAPP
|
||||
# ADD SWAP
|
||||
#=================================================
|
||||
ynh_print_info --message="Adding swap..."
|
||||
|
||||
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -85,13 +85,28 @@ 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)" = "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
|
||||
ynh_remove_app_dependencies
|
||||
ynh_remove_php
|
||||
ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
|
||||
fi
|
||||
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
|
||||
|
@ -107,12 +122,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
ynh_print_info --message="Upgrading php-fpm configuration..."
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config --phpversion="7.2"
|
||||
ynh_add_fpm_config --phpversion="7.3"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
# ADD SWAPP
|
||||
# ADD SWAP
|
||||
#=================================================
|
||||
ynh_print_info --message="Adding swap..."
|
||||
|
||||
|
@ -123,8 +138,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 +157,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
|
||||
|
|
Loading…
Add table
Reference in a new issue