Refactor rebuild process and enhance service management in rebuild-solution.sh

This commit is contained in:
2026-07-08 14:45:49 -04:00
parent 94e46a04a7
commit 2415f288f7
3 changed files with 50 additions and 42 deletions
+5 -3
View File
@@ -91,7 +91,9 @@ done
set -e # Exit on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
PROGRAM_DIR="$PROJECT_ROOT" # Assuming program directory is the project root
SQL_DIR="$PROGRAM_DIR/sql/diagnostics"
# Load database configuration
source "./db-config.sh"
@@ -116,7 +118,7 @@ invoke_diagnostic_report() {
local output_file="$1"
write_color_output "\nRunning comprehensive diagnostics..." "$CYAN"
if PGPASSWORD=$DB_PASS $PSQL_PATH -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -f "$PROJECT_ROOT/sql/diagnostics.sql" > "$output_file" 2>&1; then
if PGPASSWORD=$DB_PASS $PSQL_PATH -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -f "$SQL_DIR/diagnostics.sql" > "$output_file" 2>&1; then
write_color_output "[OK] Diagnostics completed: $output_file" "$GREEN"
else
write_color_output "[WARN] Diagnostics completed with warnings" "$YELLOW"
@@ -127,7 +129,7 @@ invoke_query_analysis() {
local output_file="$1"
write_color_output "\nAnalyzing slow queries..." "$CYAN"
if PGPASSWORD=$DB_PASS $PSQL_PATH -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -f "$PROJECT_ROOT/sql/query-analysis.sql" > "$output_file" 2>&1; then
if PGPASSWORD=$DB_PASS $PSQL_PATH -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -f "$SQL_DIR/query-analysis.sql" > "$output_file" 2>&1; then
write_color_output "[OK] Query analysis completed: $output_file" "$GREEN"
else
write_color_output "[WARN] Query analysis completed with warnings" "$YELLOW"
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
# Linux script to rebuild the Jellyfin solution properly
# This script cleans and rebuilds in the correct order to resolve CS0006 metadata errors
echo -e "\e[36mStarting Jellyfin solution rebuild...\e[0m"
# Step 1: Clean the solution
echo -e "\n\e[33m[1/3] Cleaning solution...\e[0m"
dotnet clean Jellyfin.sln --configuration Debug
# Remove obj and bin directories to ensure clean state
echo -e "\n\e[33m[2/3] Removing build artifacts...\e[0m"
find . -name bin -type d -exec rm -rf {} +
find . -name obj -type d -exec rm -rf {} +
# Step 3: Restore NuGet packages
echo -e "\n\e[33m[3/3] Restoring NuGet packages...\e[0m"
dotnet restore Jellyfin.sln
# Step 4: Build the solution
echo -e "\n\e[33m[4/4] Building solution...\e[0m"
dotnet build Jellyfin.sln --configuration Debug --no-restore
echo -e "\n\e[32mBuild complete!\e[0m"
echo -e "\e[36mIf you still see errors, try building specific projects in this order:\e[0m"
echo -e "\e[90m 1. Jellyfin.Database.Implementations\e[0m"
echo -e "\e[90m 2. Jellyfin.Database.Providers.Postgres\e[0m"
echo -e "\e[90m 3. Jellyfin.Server.Implementations\e[0m"
echo -e "\e[90m 4. Emby.Server.Implementations\e[0m"
echo -e "\e[90m 5. Jellyfin.Server\e[0m"