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

reorder steps

This commit is contained in:
yalh76 2019-05-17 16:05:27 +02:00
parent 10d6d4d2ad
commit fb3bfc1ed3
5 changed files with 58 additions and 32 deletions

View file

@ -5,7 +5,7 @@
#=================================================
# dependencies used by the app
pkg_dependencies="deb1 deb2"
pkg_dependencies="curl libzip-dev"
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-uploadprogress"

View file

@ -65,9 +65,7 @@ ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil
#=================================================
ynh_print_info --message="Installing dependencies..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#ynh_install_app_dependencies $pkg_dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE A MYSQL DATABASE
@ -79,14 +77,6 @@ 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
#=================================================
# CREATE FINAL PATH
#=================================================
ynh_print_info --message="Creating final path..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
mkdir -p "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -113,6 +103,22 @@ ynh_add_fpm_config --phpversion="7.2"
#=================================================
# SPECIFIC SETUP
#=================================================
# CREATE FINAL PATH
#=================================================
ynh_print_info --message="Creating final path..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
mkdir -p "$final_path"
#=================================================
# INSTALL PHP 7.2
#=================================================
ynh_print_info --message="Installing PHP 7.2..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#=================================================
# CREATE DRUSH ALIAS
#=================================================
@ -209,6 +215,7 @@ fi
ynh_print_info --message="Reloading nginx web server..."
ynh_systemd_action --service_name=nginx --action=reload
ynh_systemd_action --service_name=php7.2-fpm --action=reload
#=================================================
# END OF SCRIPT

View file

@ -34,22 +34,13 @@ 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
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info --message="Removing php-fpm configuration..."
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_print_info --message="Removing dependencies..."
# Remove metapackage and its dependencies
#ynh_remove_app_dependencies
ynh_remove_php
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
@ -67,15 +58,31 @@ ynh_print_info --message="Removing nginx web server configuration..."
# Remove the dedicated 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
#=================================================
# REMOVE THE CRON FILE
#=================================================
ynh_print_info --message="Removing the cron file..."
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
#=================================================
# REMOVE PHP
#=================================================
ynh_print_info --message="Removing php..."
ynh_remove_php
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -72,6 +72,12 @@ 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
#=================================================
@ -80,8 +86,7 @@ chown -R $app: $final_path
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"
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE MYSQL DATABASE
@ -92,18 +97,19 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
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
#=================================================
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# REINSTALL PHP
#=================================================
ynh_print_info --message="Reinstalling php..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -88,8 +88,7 @@ ynh_add_nginx_config
#=================================================
ynh_print_info --message="Upgrading dependencies..."
#ynh_install_app_dependencies $pkg_dependencies
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
@ -109,6 +108,13 @@ ynh_add_fpm_config --phpversion="7.2"
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE PHP
#=================================================
ynh_print_info --message="Updating PHP..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#=================================================
# UPDATE COMPOSER
#=================================================