ci: 검증 대상 리비전을 명시하고 그것이 재실행 트리거가 되게 한다
Some checks failed
Windows / verify (push) Has been cancelled
Some checks failed
Windows / verify (push) Has been cancelled
게스트 agent 는 stage2.ps1 의 해시가 바뀔 때만 다시 돈다. 그래서 커밋을 푸시해도 재검증이 안 걸렸고, 지금까지는 주석에 "rev2" 같은 문구를 넣어 해시를 억지로 바꿨다. 무엇을 검증한 결과인지도 모호했다. stage2.ps1 에 $TargetRev 를 두고 `./sync.sh <sha>` 가 그 값을 박아서 배포한다. 검증 요청(= 리비전 지정)이 그대로 재실행 트리거가 되고, 움직이는 origin/main 대신 지정한 커밋을 reset --hard 로 고정해 본다.
This commit is contained in:
@@ -212,6 +212,12 @@ Log "=== stage2 완료 ==="
|
||||
# ==================================================================
|
||||
$Repo = 'C:\win-ci\live-app-translator'
|
||||
$OutDir = 'C:\win-ci\out'
|
||||
|
||||
# 검증 대상 리비전. 'main' 이면 origin/main 최신.
|
||||
# 호스트에서 `./sync.sh <sha>` 를 쓰면 이 한 줄이 그 sha 로 바뀐 사본이 배포되고,
|
||||
# 내용이 바뀌므로 게스트 agent 가 해시 차이를 보고 20초 안에 다시 돈다.
|
||||
# = "이 커밋을 검증해라" 라는 요청이 곧 재실행 트리거다.
|
||||
$TargetRev = 'main'
|
||||
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
|
||||
|
||||
# 출력 원본을 호스트 파일로 회수한다.
|
||||
@@ -267,13 +273,16 @@ function Step($name, $block) {
|
||||
$ErrorActionPreference = 'Continue'
|
||||
try {
|
||||
Sync-Path
|
||||
if (Test-Path $Repo) {
|
||||
Log "저장소 갱신"
|
||||
Push-Location $Repo; & git fetch --all -q; & git reset --hard origin/main -q; Pop-Location
|
||||
} else {
|
||||
if (-not (Test-Path $Repo)) {
|
||||
Log "저장소 clone"
|
||||
& git clone -q https://git.tkrmagid.kr/tkrmagid/live-app-translator $Repo
|
||||
}
|
||||
$ref = if ($TargetRev -eq 'main') { 'origin/main' } else { $TargetRev }
|
||||
Log "저장소 갱신 -> $ref"
|
||||
Push-Location $Repo
|
||||
& git fetch --all -q
|
||||
& git reset --hard $ref -q
|
||||
Pop-Location
|
||||
|
||||
Push-Location $Repo
|
||||
$py = Join-Path $Repo '.venv-ci\Scripts\python.exe'
|
||||
|
||||
Reference in New Issue
Block a user