From 33a1198801bd53048be8f33b917ebd8e1492a896 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 28 Mar 2020 21:04:33 +0100 Subject: [PATCH] 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