FIX(build): init container: create build directory
- Add mkdir -p /workspace/build before copying files - Add set -e for early error detection - Add debug output for better visibility - This fixes 'No such file or directory' error
This commit is contained in:
@@ -28,11 +28,19 @@ spec:
|
|||||||
command: ["/bin/sh", "-c"]
|
command: ["/bin/sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
|
set -e
|
||||||
|
echo "Cloning repository..."
|
||||||
git clone GIT_REPO_URL /workspace/repo
|
git clone GIT_REPO_URL /workspace/repo
|
||||||
cd /workspace/repo
|
cd /workspace/repo
|
||||||
git checkout GIT_SHA
|
git checkout GIT_SHA
|
||||||
|
|
||||||
|
echo "Preparing build context..."
|
||||||
|
mkdir -p /workspace/build
|
||||||
cp -r services/nextjs/* /workspace/build/
|
cp -r services/nextjs/* /workspace/build/
|
||||||
cp deploy/docker/Dockerfile.prod /workspace/build/Dockerfile
|
cp deploy/docker/Dockerfile.prod /workspace/build/Dockerfile
|
||||||
|
|
||||||
|
echo "Build context ready:"
|
||||||
|
ls -la /workspace/build/
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
|
|||||||
Reference in New Issue
Block a user