Skip to content

Commit b2f109f

Browse files
committed
fix: prevent extra dirs being included in lambda zip bundle
1 parent ec512c5 commit b2f109f

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ jobs:
6363
mkdir /tmp/processing-lambda
6464
unzip docbox-upload-completion-lambda.zip -d /tmp/processing-lambda
6565
unzip poppler-lambda-layer.zip -d /tmp/processing-lambda
66-
zip -r docbox-upload-completion-lambda-amd64.zip /tmp/processing-lambda
66+
(
67+
cd /tmp/processing-lambda
68+
zip -r /tmp/docbox-upload-completion-lambda-amd64.zip .
69+
)
70+
mv /tmp/docbox-upload-completion-lambda-amd64.zip .
6771
shell: bash
6872

6973
# Upload the built artifacts
@@ -140,7 +144,11 @@ jobs:
140144
mkdir /tmp/processing-lambda
141145
unzip docbox-upload-completion-lambda.zip -d /tmp/processing-lambda
142146
unzip poppler-lambda-layer.zip -d /tmp/processing-lambda
143-
zip -r docbox-upload-completion-lambda-arm64.zip /tmp/processing-lambda
147+
(
148+
cd /tmp/processing-lambda
149+
zip -r /tmp/docbox-upload-completion-lambda-arm64.zip .
150+
)
151+
mv /tmp/docbox-upload-completion-lambda-arm64.zip .
144152
shell: bash
145153

146154
# Upload the built artifacts

layers/make-poppler-layer-amd64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ docker buildx build --build-arg BASE_IMAGE=public.ecr.aws/lambda/provided:al2023
66

77
# Run a container and copy out the zip then delete it
88
CONTAINER_ID=$(docker create --platform linux/amd64 poppler-lambda-layer-amd64)
9-
docker cp $CONTAINER_ID:/poppler-lambda-layer.zip ./poppler-lambda-layer.zip
9+
docker cp $CONTAINER_ID:/tmp/poppler-lambda-layer.zip ./poppler-lambda-layer.zip
1010
docker rm $CONTAINER_ID

layers/make-poppler-layer-arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ docker buildx build --build-arg BASE_IMAGE=public.ecr.aws/lambda/provided:al2023
66

77
# Run a container and copy out the zip then delete it
88
CONTAINER_ID=$(docker create --platform linux/arm64 poppler-lambda-layer-arm64)
9-
docker cp $CONTAINER_ID:/poppler-lambda-layer.zip ./poppler-lambda-layer.zip
9+
docker cp $CONTAINER_ID:/tmp/poppler-lambda-layer.zip ./poppler-lambda-layer.zip
1010
docker rm $CONTAINER_ID

layers/poppler.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ RUN cp -r /usr/share/fonts/* /bundle/opt/fonts/ && \
3131
RUN chmod -R 755 /bundle/opt
3232

3333
# Zip up the bundle as the layer
34-
RUN zip -r /poppler-lambda-layer.zip /bundle
34+
RUN cd /bundle/opt && \
35+
zip -r /tmp/poppler-lambda-layer.zip .

0 commit comments

Comments
 (0)