diff --git a/scripts/upgrade b/scripts/upgrade index 7b5d5ec..66bd828 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,15 +108,11 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - ynh_install_composer --workdir="$final_path" --install_args="--prefer-source --no-dev" + ynh_install_composer --workdir="$final_path" --install_args="--no-dev" pushd $final_path - php$phpversion artisan migrate -n --force + php$phpversion artisan migrate #-n --force popd - - ynh_backup_if_checksum_is_different --file="$final_path/.env" - # Recalculate and store the checksum of the file for the next upgrade. - ynh_store_file_checksum --file="$final_path/.env" fi #================================================= @@ -150,6 +146,23 @@ 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" +#================================================= +# BUILDING +#================================================= +ynh_script_progression --message="Building..." + +ynh_backup_if_checksum_is_different --file="$final_path/.env" +# Setup application config +cp ../conf/.env.example $final_path/.env + +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env" +ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/.env" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/.env" +ynh_replace_string --match_string="__PUBLICPATH__" --replace_string="$public_path" --target_file="$final_path/.env" + +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum --file="$final_path/.env" + # SECURE FILES AND DIRECTORIES #=================================================