mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Deploy workflow_approve_rerun_lambda as zip package
This commit is contained in:
parent
0db9dda5f3
commit
2338d01a20
3
tests/ci/.gitignore
vendored
Normal file
3
tests/ci/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*_lambda/lambda-venv
|
||||
*_lambda/lambda-package
|
||||
*_lambda/lambda-package.zip
|
2
tests/ci/team_keys_lambda/.gitignore
vendored
2
tests/ci/team_keys_lambda/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
lambda-venv
|
||||
lambda-package.zip
|
@ -1,15 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -xeo pipefail
|
||||
|
||||
WORKDIR=$(dirname "$0")
|
||||
cd "$WORKDIR"
|
||||
|
||||
PY_EXEC=python3.9
|
||||
LAMBDA_NAME=$(basename "$PWD")
|
||||
LAMBDA_NAME=${LAMBDA_NAME//_/-}
|
||||
VENV=lambda-venv
|
||||
py_exec=$(which python3)
|
||||
py_version=$(basename "$(readlink -f "$py_exec")")
|
||||
rm -rf "$VENV" lambda-package.zip
|
||||
virtualenv "$VENV"
|
||||
"$PY_EXEC" -m venv "$VENV"
|
||||
#virtualenv "$VENV"
|
||||
# shellcheck disable=SC1091
|
||||
source "$VENV/bin/activate"
|
||||
pip install -r requirements.txt
|
||||
PACKAGES="$VENV/lib/$py_version/site-packages"
|
||||
cp app.py "$PACKAGES/"
|
||||
( cd "$PACKAGES" && zip -r ../../../../lambda-package.zip . )
|
||||
PACKAGE=lambda-package
|
||||
rm -rf "$PACKAGE" "$PACKAGE".zip
|
||||
cp -r "$VENV/lib/$PY_EXEC/site-packages" "$PACKAGE"
|
||||
cp app.py "$PACKAGE"
|
||||
rm -r "$PACKAGE"/{pip,pip-*,setuptools,setuptools-*}
|
||||
( cd "$PACKAGE" && zip -r ../"$PACKAGE".zip . )
|
||||
|
||||
aws lambda update-function-code --function-name team-keys-lambda --zip-file fileb://lambda-package.zip
|
||||
aws lambda update-function-code --function-name "$LAMBDA_NAME" --zip-file fileb://"$PACKAGE".zip
|
||||
|
@ -1,13 +0,0 @@
|
||||
FROM public.ecr.aws/lambda/python:3.9
|
||||
|
||||
# Install the function's dependencies using file requirements.txt
|
||||
# from your project folder.
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
|
||||
|
||||
# Copy function code
|
||||
COPY app.py ${LAMBDA_TASK_ROOT}
|
||||
|
||||
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
|
||||
CMD [ "app.handler" ]
|
@ -0,0 +1 @@
|
||||
../team_keys_lambda/build_and_deploy_archive.sh
|
Loading…
Reference in New Issue
Block a user