Skip to content

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdebosschere committed Nov 9, 2020
1 parent d52790a commit 3cd0050
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ inputs:
description: "The function name/ARN to update"
required: true
alias:
description: "The alias to place on the deployed version (default: Live)"
description: "The alias to place on the deployed version (default: Live). Alias have to pre-exist"
default: "Live"
required: false
required: true
runs:
using: docker
image: Dockerfile
4 changes: 2 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ export PACKAGE_S3_KEY=$INPUT_PACKAGE_S3_KEY
export FUNCTION_NAME=$INPUT_FUNCTION_NAME
export ALIAS=$INPUT_ALIAS



echo "Getting the current version associated to the alias + CodeSha256"
CURRENT_FUNCTION_VERSION=$(aws lambda get-alias --function-name $FUNCTION_NAME --name $ALIAS | jq '.FunctionVersion' | sed 's/"//g' )
CURRENT_FUNCTION_SHA=$(aws lambda get-function-configuration --function-name $FUNCTION_NAME \
--qualifier $CURRENT_FUNCTION_VERSION --query "CodeSha256")
echo "Current SHA256: ${CURRENT_FUNCTION_SHA}"
echo "Updating the function code"
UPDATE_RESULT=$(aws lambda update-function-code --function-name $FUNCTION_NAME --s3-bucket $PACKAGE_S3_BUCKET --s3-key $PACKAGE_S3_KEY)
UPDATE_STATUS=$(echo $UPDATE_RESULT | jq '.LastUpdateStatus' | sed 's/"//g')
Expand All @@ -21,6 +20,7 @@ if [ $UPDATE_STATUS != "Successful" ]; then
exit 1
fi
FUNCTION_SHA=$(echo $UPDATE_RESULT | jq '.CodeSha256')
echo "New SHA256: ${FUNCTION_SHA}"
if [[ $CURRENT_FUNCTION_SHA == $FUNCTION_SHA ]]; then
echo "Same function code, skipping"
exit 0
Expand Down
32 changes: 0 additions & 32 deletions test.sh

This file was deleted.

0 comments on commit 3cd0050

Please sign in to comment.