diff --git a/Jenkinsfile b/Jenkinsfile index 4d733ab..bb613ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,15 +42,28 @@ pipeline { apt-get update apt-get install -y --no-install-recommends \ ca-certificates curl unzip jq git openjdk-21-jre-headless + + # --- Install ICU runtime (Debian uses versioned package names) --- + if ! ldconfig -p | grep -qi libicu; then + PKG="$(apt-cache search '^libicu[0-9]+$' | awk '{print $1}' | head -n1 || true)" + if [ -n "$PKG" ]; then + echo "Installing ICU package: ${PKG}" + apt-get install -y --no-install-recommends "${PKG}" + else + # Fallback: dev package also provides the libs (heavier) + echo "Falling back to libicu-dev..." + apt-get install -y --no-install-recommends libicu-dev + fi + fi fi - mkdir -p "${DOTNET_ROOT}" + # Install .NET SDK locally for the build user + mkdir -p "${WORKSPACE}/.dotnet" curl -fsSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh - bash dotnet-install.sh --channel 9.0 --install-dir "${DOTNET_ROOT}" - dotnet --info + bash dotnet-install.sh --channel 9.0 --install-dir "${WORKSPACE}/.dotnet" - # เตรียม cache สำหรับ Dependency-Check - mkdir -p "${DC_DATA}" + export PATH="${WORKSPACE}/.dotnet:${PATH}" + dotnet --info ''' } }