From c1070c3eeff62530a9683f8e90b8edccd8e5d046 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 2 Apr 2019 03:04:01 +0200 Subject: [PATCH] upgrade helper --- scripts/_common.sh | 14 ++++++++++---- scripts/install | 14 +++++++++++++- scripts/restore | 21 ++++++++++++++++----- scripts/upgrade | 14 +++++++++++++- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index f6a9538d..f036f1df 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,12 +5,18 @@ #================================================= # dependencies used by the app -pkg_dependencies="php7.2-pgsql php7.2-mbstring php7.2-bcmath php7.2-simplexml php7.2-curl postgresql redis-server \ -php7.2-intl php7.2-exif \ -libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libwebp6 libmagickwand-6.q16-3 \ -php7.2-gd \ +pkg_dependencies="postgresql redis-server \ +libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libwebp6 libmagickwand-6.q16-3\ pngquant jpegoptim gifsicle" +extra_pkg_dependencies="php7.2-pgsql php7.2-mbstring php7.2-bcmath php7.2-simplexml php7.2-curl php7.2-intl php7.2-exif php7.2-gd" +# +# +# +# +# +# +# #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 4c263969..8849cdab 100644 --- a/scripts/install +++ b/scripts/install @@ -52,9 +52,21 @@ ynh_app_setting_set "$app" is_public "$is_public" #================================================= ynh_print_info "Installing dependencies..." +ynh_install_app_dependencies "$pkg_dependencies" + +#================================================= +# INSTALL PHP +#================================================= +ynh_print_info "Installing php..." + ynh_install_php --phpversion="7.2" -ynh_install_app_dependencies "$pkg_dependencies" +#================================================= +# INSTALL PHP DEPENDENCIES +#================================================= +ynh_print_info "Installing php dependencies..." + +ynh_install_extra_app_dependencies --repo="https://packages.sury.org/php/ $(lsb_release -sc) main" --key="https://packages.sury.org/php/apt.gpg" --package="$extra_pkg_dependencies" #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 549039d4..6b36ebf4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -73,15 +73,26 @@ chown -R "$app": "$final_path" #================================================= # SPECIFIC RESTORATION #================================================= -# REINSTALL DEPENDENCIES +# INSTALL DEPENDENCIES #================================================= -ynh_print_info "Reinstalling dependencies..." - -# Define and install dependencies -ynh_install_php --phpversion="7.2" +ynh_print_info "Installing dependencies..." ynh_install_app_dependencies "$pkg_dependencies" +#================================================= +# INSTALL PHP +#================================================= +ynh_print_info "Installing php..." + +ynh_install_php --phpversion="7.2" + +#================================================= +# INSTALL PHP DEPENDENCIES +#================================================= +ynh_print_info "Installing php dependencies..." + +ynh_install_extra_app_dependencies --repo="https://packages.sury.org/php/ $(lsb_release -sc) main" --key="https://packages.sury.org/php/apt.gpg" --package="$extra_pkg_dependencies" + #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba7bb706..e39f6a90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,9 +99,21 @@ ynh_add_nginx_config #================================================= ynh_print_info "Upgrading dependencies..." +ynh_install_app_dependencies "$pkg_dependencies" + +#================================================= +# UPGRADE PHP +#================================================= +ynh_print_info "Upgrading php..." + ynh_install_php --phpversion="7.2" -ynh_install_app_dependencies "$pkg_dependencies" +#================================================= +# UPGRADE PHP DEPENDENCIES +#================================================= +ynh_print_info "Upgrading php dependencies..." + +ynh_install_extra_app_dependencies --repo="https://packages.sury.org/php/ $(lsb_release -sc) main" --key="https://packages.sury.org/php/apt.gpg" --package="$extra_pkg_dependencies" #================================================= # CREATE DEDICATED USER