Created
September 16, 2022 14:26
-
-
Save okelet/439c2f425793ecf3fe721cefa8c284d3 to your computer and use it in GitHub Desktop.
Simple shell script to generate a ZIP package for a script whose dependencies are defined using Poetry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
TMP_DIR=$(mktemp -d --suffix=.poetry-lambda-generate-zip) | |
APP_DIR=$(pwd) | |
rm -Rf dist | |
mkdir dist | |
poetry run pip -q --disable-pip-version-check install -t ${TMP_DIR}/package . | |
cd ${TMP_DIR}/package | |
zip -q -x "*.pyc" -x "**/__pycache__/*" -r ${APP_DIR}/dist/lambda.zip . | |
cd ${APP_DIR} | |
rm -Rf ${TMP_DIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment