fix(ci): use owned directory for native builds

This commit is contained in:
dahyeon committed 2026-07-26 03:12:54 +09:00
1 parent 966e109d28
commit 979745c7a0
1 file changed
+7 -6
+7 -6
View File
@@ -159,14 +159,14 @@ spec:
- name: credentials
volumeMounts:
- name: build-source
mountPath: /workspace/build-source
mountPath: /workspace/build
env:
- name: REPO_URL
value: https://git.dahyeon.us/dahyeon/lolympus-tournament-support.git
script: |
#!/bin/sh
set -eu
SOURCE_DIR=/workspace/build-source
SOURCE_DIR=/workspace/build/source
REVISION="$(params.revision)"
AUTH_HOME="$(mktemp -d)"
trap 'rm -rf "$AUTH_HOME"' EXIT
@@ -179,6 +179,7 @@ spec:
EOF
chmod 0600 "$AUTH_HOME/.netrc"
export HOME="$AUTH_HOME"
mkdir -p "$SOURCE_DIR"
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
@@ -189,7 +190,7 @@ spec:
fi
- name: build-and-push
image: docker.io/moby/buildkit:v0.31.1-rootless@sha256:946cf909534b789c9b84af75e6d4f8cb23c3b9cb387daec5ba0f4878a3e4647c
workingDir: /workspace/build-source
workingDir: /workspace/build/source
computeResources:
requests: {cpu: "1", memory: 2Gi}
limits: {cpu: "4", memory: 8Gi}
@@ -207,7 +208,7 @@ spec:
- name: dockerconfig
volumeMounts:
- name: build-source
mountPath: /workspace/build-source
mountPath: /workspace/build
- name: buildkit-state
mountPath: /home/user/.local/share/buildkit
env:
@@ -235,7 +236,7 @@ spec:
--metadata-file "$(results.image-digest.path)"
- name: record-digest
image: docker.io/mikefarah/yq:4.47.2@sha256:76def1f56f456ecc1c3173ea275218ee17139bc2018c5a07887b15afd88ec03e
workingDir: /workspace/build-source
workingDir: /workspace/build/source
computeResources:
requests: {cpu: 50m, memory: 64Mi}
limits: {cpu: 250m, memory: 256Mi}
@@ -249,7 +250,7 @@ spec:
- ALL
volumeMounts:
- name: build-source
mountPath: /workspace/build-source
mountPath: /workspace/build
script: |
#!/bin/sh
set -eu