Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion integration-tests/scripts/build-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,18 @@ build_python_lambda() {
# Install dependencies with Docker using ARM64 platform
# Use the same image that CDK would use for consistency
# Mount pip cache for faster package downloads
# set -e is off inside a function that an if condition calls, so check
# the exit status. The package/ check below cannot see
# a pip failure, because it runs after the .py files are copied in.
docker run --rm --platform linux/arm64 \
-v "$LAMBDA_DIR":/workspace \
-v "$PIP_CACHE_DIR":/root/.cache/pip \
-w /workspace \
public.ecr.aws/sam/build-python3.12 \
pip install -r requirements.txt -t package/
pip install -r requirements.txt -t package/ || {
echo "✗ Build failed: docker run ... pip install exited with status $?"
return 1
}

# Copy source files to package directory
cp -r "$LAMBDA_DIR"/*.py "$LAMBDA_DIR/package/" 2>/dev/null || true
Expand Down
Loading