mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Do not upload unnecessary lambda sources
This commit is contained in:
parent
5f3c7524bc
commit
4b2bba2ff1
@ -7,18 +7,20 @@ cd "$WORKDIR"
|
||||
PY_EXEC=python3.9
|
||||
LAMBDA_NAME=$(basename "$PWD")
|
||||
LAMBDA_NAME=${LAMBDA_NAME//_/-}
|
||||
VENV=lambda-venv
|
||||
rm -rf "$VENV" lambda-package.zip
|
||||
"$PY_EXEC" -m venv "$VENV"
|
||||
#virtualenv "$VENV"
|
||||
# shellcheck disable=SC1091
|
||||
source "$VENV/bin/activate"
|
||||
pip install -r requirements.txt
|
||||
PACKAGE=lambda-package
|
||||
rm -rf "$PACKAGE" "$PACKAGE".zip
|
||||
cp -r "$VENV/lib/$PY_EXEC/site-packages" "$PACKAGE"
|
||||
mkdir "$PACKAGE"
|
||||
cp app.py "$PACKAGE"
|
||||
rm -r "$PACKAGE"/{pip,pip-*,setuptools,setuptools-*}
|
||||
( cd "$PACKAGE" && zip -r ../"$PACKAGE".zip . )
|
||||
if [ -f requirements.txt ]; then
|
||||
VENV=lambda-venv
|
||||
rm -rf "$VENV" lambda-package.zip
|
||||
"$PY_EXEC" -m venv "$VENV"
|
||||
# shellcheck disable=SC1091
|
||||
source "$VENV/bin/activate"
|
||||
pip install -r requirements.txt
|
||||
cp -rT "$VENV/lib/$PY_EXEC/site-packages/" "$PACKAGE"
|
||||
rm -r "$PACKAGE"/{pip,pip-*,setuptools,setuptools-*}
|
||||
fi
|
||||
( cd "$PACKAGE" && zip -9 -r ../"$PACKAGE".zip . )
|
||||
|
||||
aws lambda update-function-code --function-name "$LAMBDA_NAME" --zip-file fileb://"$PACKAGE".zip
|
||||
|
Loading…
Reference in New Issue
Block a user