Reuse the agent container mounts for the build step.
office.sejong.dev/pipeline/head There was a failure building this commit
office.sejong.dev/pipeline/head There was a failure building this commit
The agent talks to the host daemon over docker.sock, so binding the in-container workspace path failed on the NAS. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
34d5aa547f
commit
4bffd65b32
1 file changed
+8
-2
Vendored
+8
-2
@@ -20,12 +20,18 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eu
|
||||||
|
# DooD: docker.sock talks to the host daemon, so -v "$PWD" looks for
|
||||||
|
# that path on the NAS and fails. Reuse the agent container mounts.
|
||||||
|
if docker inspect "$(hostname)" >/dev/null 2>&1; then
|
||||||
|
set -- --volumes-from "$(hostname)" -w "$PWD"
|
||||||
|
else
|
||||||
|
set -- -v "$PWD":/app -w /app
|
||||||
|
fi
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-u "$(id -u):$(id -g)" \
|
-u "$(id -u):$(id -g)" \
|
||||||
-e HOME=/tmp \
|
-e HOME=/tmp \
|
||||||
-e NODE_OPTIONS \
|
-e NODE_OPTIONS \
|
||||||
-v "$PWD":/app \
|
"$@" \
|
||||||
-w /app \
|
|
||||||
"$NODE_IMAGE" \
|
"$NODE_IMAGE" \
|
||||||
bash -lc 'npm ci && npm run build'
|
bash -lc 'npm ci && npm run build'
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in new issue
Block a user