Skip to content

Commit

Permalink
Merge pull request #72 from rhettre/feature/release-workflow
Browse files Browse the repository at this point in the history
Update release process
  • Loading branch information
rhettre authored Jul 27, 2024
2 parents 016d726 + 8a5000e commit 4b2a4ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
--output type=docker \
-f Dockerfile .
docker create --name layer_builder lambda-layer-builder:${{ matrix.architecture }}
docker cp layer_builder:/asset-output/layer.zip layer-${{ matrix.architecture }}.zip
docker cp layer_builder:/tmp/layer.zip layer-${{ matrix.architecture }}.zip
- name: Get Release
id: get_release
Expand Down
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ WORKDIR /var/task
# Copy your application code and requirements.txt into the Docker image
COPY . .

# Install dependencies
# Install dependencies and create the layer
RUN pip install --upgrade pip setuptools wheel && \
pip install -r requirements.txt && \
pip install .

# Package everything into a ZIP file
CMD mkdir -p python/lib/python3.9/site-packages && \
pip install . && \
mkdir -p python/lib/python3.9/site-packages && \
pip install \
--platform manylinux2014_$(uname -m) \
--platform manylinux2014_x86_64 \
--implementation cp \
--python-version 3.9 \
--only-binary=:all: --upgrade \
-r requirements.txt -t python/lib/python3.9/site-packages && \
pip install . -t python/lib/python3.9/site-packages && \
cd python/lib/python3.9/site-packages && \
zip -r9 /asset-output/layer.zip . && \
cd /var/task
zip -r9 /tmp/layer.zip . && \
cd /var/task

# Copy the layer.zip to a known location
CMD cp /tmp/layer.zip /asset-output/layer.zip

0 comments on commit 4b2a4ed

Please sign in to comment.