1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/drupal7_ynh.git synced 2024-09-03 18:26:19 +02:00

Merge pull request #9 from YunoHost-Apps/testing

Full implementation
This commit is contained in:
yalh76 2019-04-29 22:28:52 +02:00 committed by GitHub
commit 62a6a64365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 56 deletions

View file

@ -14,12 +14,12 @@
setup_nourl=0 setup_nourl=0
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=0 upgrade=1
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1 incorrect_path=1
port_already_use=0 port_already_use=0
change_url=0 change_url=1
;;; Levels ;;; Levels
Level 1=auto Level 1=auto
Level 2=auto Level 2=auto

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/__APP__/ ; alias __FINALPATH__/__NAME__/ ;
index index.php; index index.php;
if (!-e $request_filename) if (!-e $request_filename)
{ {
@ -58,7 +58,7 @@ location __PATH__/ {
location ~ '[^/]\.php$|^/update.php' { location ~ '[^/]\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm-__APP__.sock; fastcgi_pass unix:/var/run/php/php7.2-fpm-__NAME__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;

View file

@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors

View file

@ -83,8 +83,16 @@ fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# ... # UPDATE DRUSH ALIAS
#================================================= #=================================================
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"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION

View file

@ -95,7 +95,7 @@ mkdir -p "$final_path"
ynh_print_info --message="Configuring nginx web server..." ynh_print_info --message="Configuring nginx web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config "app" ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER

View file

@ -34,6 +34,14 @@ ynh_print_info --message="Removing the MySQL database"
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info --message="Removing php-fpm configuration"
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -59,14 +67,6 @@ ynh_print_info --message="Removing nginx web server configuration"
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info --message="Removing php-fpm configuration"
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================

View file

@ -7,6 +7,9 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_add_extra_apt_repos__3
source ynh_install_php__3
source ynh_composer__2
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
@ -64,18 +67,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
# N.B. : this is for app installations before YunoHost 2.7
# where this value might be something like /foo/ or foo/
# instead of /foo ....
# If nobody installed your app before 2.7, then you may
# safely remove this line
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -84,7 +75,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
ynh_print_info --message="Upgrading source files..." ynh_print_info --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" #ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -99,7 +90,8 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_print_info --message="Upgrading dependencies..." ynh_print_info --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies #ynh_install_app_dependencies $pkg_dependencies
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -107,7 +99,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_print_info --message="Making sure dedicated system user exists..." ynh_print_info --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -115,35 +107,39 @@ ynh_system_user_create --username=$app
ynh_print_info --message="Upgrading php-fpm configuration..." ynh_print_info --message="Upgrading php-fpm configuration..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config --phpversion="7.2"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# ... # UPDATE COMPOSER
#=================================================
ynh_print_info --message="Updating Composer..."
ynh_install_composer --phpversion="7.2" --workdir="$final_path/.composer"
#=================================================
# UPDATE DRUPAL
#=================================================
ynh_print_info --message="Updating Drupal..."
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 vset --exact maintenance_mode 0
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
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#================================================= #=================================================
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php"
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/CONFIG_FILE" ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_print_info --message="Upgrading logrotate configuration..."
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_print_info --message="Upgrading systemd configuration..."
# Create a dedicated systemd config
ynh_add_systemd_config
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -152,7 +148,7 @@ ynh_add_systemd_config
#================================================= #=================================================
# Set permissions on app files # Set permissions on app files
chown -R root: $final_path chown -R $app: $final_path
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT