diff --git a/ci/blog/README.md b/ci/blog/README.md index 15221ee..596aec6 100644 --- a/ci/blog/README.md +++ b/ci/blog/README.md @@ -65,6 +65,11 @@ CI에서 source SHA + LF + PipelineRun UID의 SHA-256 앞 16자를 계산하고 같은 CDN 설정을 SSR·WASM에 컴파일합니다. BuildKit은 단일 solve에서 image와 local rootfs를 함께 내보냅니다. `/app/site`를 다시 빌드하지 않고 앱 저장소 `tools/cdn`으로 포장합니다. +CDN 단계의 `workingDir`는 공유 볼륨 루트인 `/workspace/build`로 두고, 스크립트에서 +`cd /workspace/build/source`를 실행합니다. 아직 clone하지 않은 경로를 `workingDir`로 +지정하면 컨테이너 준비 과정이 root 소유 디렉터리를 먼저 만들어 UID 1000의 Git 쓰기를 +막을 수 있습니다. checkout 디렉터리는 `clone-source`가 직접 만들도록 유지합니다. + `pkg/`는 원본·br·gzip, `assets/`는 WOFF2 원본만 S3에 게시합니다. 나머지 공개 파일은 프로젝트 HTTPS 원본이 제공합니다. 모든 객체를 조건부 PUT 후 checksum-enabled HEAD로 검사하며, 완료 매니페스트가 성공해야 CDN Task 결과와 후속 GitOps 갱신을 허용합니다. diff --git a/ci/blog/tasks.yaml b/ci/blog/tasks.yaml index da2411d..d4748ed 100644 --- a/ci/blog/tasks.yaml +++ b/ci/blog/tasks.yaml @@ -258,7 +258,8 @@ spec: test "$(git -C /workspace/build/source rev-parse HEAD)" = "$REVISION" - name: prepare-cdn image: docker.io/library/node:26.7.0-trixie-slim@sha256:5758d367d7b4f48b73a9bb3530e687e47efb289f3b43f9c0450a25225ae0db5d - workingDir: /workspace/build/source + # The checkout must be created by clone-source as UID 1000, not by container startup. + workingDir: /workspace/build computeResources: requests: cpu: 100m @@ -282,6 +283,7 @@ spec: script: | #!/bin/sh set -eu + cd /workspace/build/source npm ci --prefix tools/cdn --ignore-scripts --no-audit --no-fund npm test --prefix tools/cdn node tools/cdn/cli.mjs check-config --release-result /workspace/build/release-id @@ -387,7 +389,7 @@ spec: printf '%s' "$DIGEST" >"$DIGEST_RESULT_PATH" - name: publish-cdn image: docker.io/library/node:26.7.0-trixie-slim@sha256:5758d367d7b4f48b73a9bb3530e687e47efb289f3b43f9c0450a25225ae0db5d - workingDir: /workspace/build/source + workingDir: /workspace/build computeResources: requests: cpu: 250m @@ -418,6 +420,7 @@ spec: script: | #!/bin/sh set -eu + cd /workspace/build/source node tools/cdn/cli.mjs package \ --site-root /workspace/build/runtime/app/site \ --output-root /workspace/build/cdn \