Improve dry run for lambda deployment

This commit is contained in:
Mikhail f. Shiryaev 2024-01-29 13:30:25 +01:00
parent bd5529dda1
commit 4ee7275f21
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -35,6 +35,8 @@ if [ -f requirements.txt ]; then
fi
( cd "$PACKAGE" && zip -9 -r ../"$PACKAGE".zip . )
if [ -z "$DRY_RUN" ]; then
aws lambda update-function-code --function-name "$LAMBDA_NAME" --zip-file fileb://"$WORKDIR/$PACKAGE".zip
ECHO=()
if [ -n "$DRY_RUN" ]; then
ECHO=(echo Run the following command to push the changes:)
fi
"${ECHO[@]}" aws lambda update-function-code --function-name "$LAMBDA_NAME" --zip-file fileb://"$WORKDIR/$PACKAGE".zip