From 983133ff9390e7ecacdfeb76b62f9d575b0cf307 Mon Sep 17 00:00:00 2001 From: bgorbuntsov <54511351+bgorbuntsov@users.noreply.github.com> Date: Thu, 28 Nov 2024 21:23:53 +0000 Subject: [PATCH] source with dot replaced. Py venv errors processing added (#277) Co-authored-by: Boris Gorbuntsov --- .../scripts/lambda-build/create-package.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/terraform-aws-ca-lambda/scripts/lambda-build/create-package.sh b/modules/terraform-aws-ca-lambda/scripts/lambda-build/create-package.sh index 7b7cce2f..070bc58c 100755 --- a/modules/terraform-aws-ca-lambda/scripts/lambda-build/create-package.sh +++ b/modules/terraform-aws-ca-lambda/scripts/lambda-build/create-package.sh @@ -21,8 +21,18 @@ dir_name=$function_name/ mkdir -p $path_cwd/build/$dir_name # Create and activate virtual environment... -python3 -m venv $path_cwd/build/env_$function_name -source $path_cwd/build/env_$function_name/bin/activate +if ! python3 -m venv $path_cwd/build/env_$function_name; then + echo "Error: Python virtual environment creation failed" + exit 1 +else + echo "Python virtual environment created" +fi +if ! . $path_cwd/build/env_$function_name/bin/activate; then + echo "Error: Python virtual environment activation failed" + exit 1 +else + echo "Python virtual environment activated" +fi # Installing python dependencies... FILE=$path_cwd/lambda_code/$function_name/requirements.txt