diff --git a/scripts/upgrade b/scripts/upgrade index e0356b1..b462dca 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,12 +107,6 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - - # ynh_install_composer --workdir="$final_path" --install_args="--no-dev" - - # pushd $final_path - # php$phpversion artisan migrate #-n --force - # popd fi #================================================= @@ -146,26 +140,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" -#================================================= -# INSTALL AND INITIALIZE COMPOSER -#================================================= -ynh_script_progression --message="Installing Composer..." --weight=10 - -# Install Composer -ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--prefer-source --no-dev" - -ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\" - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=4 - pushd $final_path - php artisan migrate -n #--force - #php$phpversion artisan config:clear -n - #php$phpversion artisan config:cache -n - popd -fi - #================================================= # SETUP APPLICATION CONFIG #================================================= @@ -183,6 +157,29 @@ ynh_replace_string --match_string="__PUBLICPATH__" --replace_string="$public_pat # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/.env" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Installing Composer..." --weight=1 + +# Upgrade composer itself +ynh_install_composer --phpversion=${phpversion} --workdir=$final_path --install_args="--prefer-source --no-dev" + +#================================================= +# INSTALL AND INITIALIZE COMPOSER +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading Lychee source files..." --weight=4 + pushd $final_path + php$phpversion artisan migrate --no-interaction + #php$phpversion artisan config:clear --no-interaction + #php$phpversion artisan config:cache --no-interaction + popd +fi + +#================================================= # SECURE FILES AND DIRECTORIES #=================================================