fix(ci): download-ollama.ps1 메시지 영문화 — 한글 인코딩으로 PowerShell 파싱 실패 해소

This commit is contained in:
yunchan8804 2026-04-15 20:49:00 +09:00
parent 31902513bd
commit 8a8fb63636

View file

@ -1,9 +1,9 @@
# scripts/download-ollama.ps1
# Ollama Windows 바이너리(포터블)를 resources/ollama/에 배치한다.
# 실행: powershell -ExecutionPolicy Bypass -File scripts/download-ollama.ps1
# Downloads the portable Ollama Windows binary into resources/ollama/.
# Usage: powershell -ExecutionPolicy Bypass -File scripts/download-ollama.ps1
#
# 주: Ollama 공식은 NSIS 설치러너만 배포하므로, 여기서는 압축 형식으로 배포되는
# ollama-windows-amd64.zip(release asset)을 GitHub에서 받는다.
# Note: Ollama only ships an NSIS installer officially. We use the
# ollama-windows-amd64.zip release asset on GitHub instead.
$ErrorActionPreference = "Stop"
@ -13,47 +13,49 @@ $DEST_DIR = Join-Path $PSScriptRoot "..\resources\ollama"
$TEMP_ZIP = Join-Path $env:TEMP "ollama-$OLLAMA_VERSION-windows-amd64.zip"
$TEMP_DIR = Join-Path $env:TEMP "ollama-extract"
Write-Host "=== Ollama $OLLAMA_VERSION Windows 바이너리 다운로드 ===" -ForegroundColor Cyan
Write-Host "=== Ollama $OLLAMA_VERSION (Windows amd64) ===" -ForegroundColor Cyan
if (Test-Path (Join-Path $DEST_DIR "ollama.exe")) {
Write-Host "Ollama가 이미 존재합니다: $DEST_DIR\ollama.exe" -ForegroundColor Green
Write-Host "Ollama already present: $DEST_DIR\ollama.exe" -ForegroundColor Green
exit 0
}
if (Test-Path $TEMP_ZIP) { Remove-Item -Force $TEMP_ZIP }
Write-Host "다운로드 중: $OLLAMA_URL"
Write-Host "Downloading: $OLLAMA_URL"
try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $OLLAMA_URL -OutFile $TEMP_ZIP -UseBasicParsing
} catch {
Write-Host "자동 다운로드 실패: $_" -ForegroundColor Red
Write-Host "Auto-download failed: $_" -ForegroundColor Red
Write-Host ""
Write-Host "=== 수동 설치 방법 ===" -ForegroundColor Yellow
Write-Host "https://github.com/ollama/ollama/releases 에서 ollama-windows-amd64.zip 다운로드 후"
Write-Host "압축 해제해 ollama.exe를 아래 경로로 복사:" -ForegroundColor White
Write-Host "=== Manual install ===" -ForegroundColor Yellow
Write-Host "Download ollama-windows-amd64.zip from:"
Write-Host " https://github.com/ollama/ollama/releases"
Write-Host "and extract its contents into:"
Write-Host " $DEST_DIR"
exit 1
}
$fileSize = (Get-Item $TEMP_ZIP).Length
if ($fileSize -lt 1000000) {
Write-Host "다운로드된 파일이 너무 작습니다 (${fileSize} bytes)." -ForegroundColor Red
Write-Host ("Downloaded file too small ({0} bytes)." -f $fileSize) -ForegroundColor Red
exit 1
}
Write-Host "다운로드 완료 ($([math]::Round($fileSize / 1MB, 1)) MB)"
Write-Host "압축 해제 중..."
$sizeMB = [math]::Round($fileSize / 1MB, 1)
Write-Host ("Download complete ({0} MB)" -f $sizeMB)
Write-Host "Extracting..."
if (Test-Path $TEMP_DIR) { Remove-Item -Recurse -Force $TEMP_DIR }
Expand-Archive -Path $TEMP_ZIP -DestinationPath $TEMP_DIR -Force
New-Item -ItemType Directory -Force -Path $DEST_DIR | Out-Null
# zip 구조: ollama.exe + lib/ (DLL 등). 모두 복사.
# zip layout: ollama.exe + lib/ (DLLs). Copy everything.
Get-ChildItem -Path $TEMP_DIR -Force | ForEach-Object {
Copy-Item $_.FullName -Destination $DEST_DIR -Recurse -Force
Write-Host " 복사: $($_.Name)" -ForegroundColor Green
Write-Host (" copied: {0}" -f $_.Name) -ForegroundColor Green
}
Remove-Item -Recurse -Force $TEMP_DIR -ErrorAction SilentlyContinue
@ -61,9 +63,10 @@ Remove-Item -Force $TEMP_ZIP -ErrorAction SilentlyContinue
if (Test-Path (Join-Path $DEST_DIR "ollama.exe")) {
$ollamaSize = (Get-Item (Join-Path $DEST_DIR "ollama.exe")).Length
$ollamaMB = [math]::Round($ollamaSize / 1MB, 1)
Write-Host ""
Write-Host "Ollama 설치 완료: $DEST_DIR ($([math]::Round($ollamaSize / 1MB, 1)) MB)" -ForegroundColor Green
Write-Host ("Ollama installed: {0} ({1} MB)" -f $DEST_DIR, $ollamaMB) -ForegroundColor Green
} else {
Write-Host "ollama.exe를 찾을 수 없습니다. zip 구조를 확인하세요." -ForegroundColor Red
Write-Host "ollama.exe not found after extraction. Inspect the zip layout." -ForegroundColor Red
exit 1
}