Skip to content
This repository was archived by the owner on Jul 20, 2024. It is now read-only.

Commit cde4e94

Browse files
author
Pete
authored
Merge pull request #3 from seattleagainstslavery/feature/add_support_for_multiple_layers_and_functions
fixes passing arguments to shell function
2 parents 3d6bdec + 0085554 commit cde4e94

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

entrypoint.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ publish_custom_layers(){
4343
CUSTOM_LAYER_4_VERSION=$(jq '.Version' <<< "$result")
4444
}
4545

46-
publish_function(name){
47-
echo "Deploying the code for ${name}"
48-
zip -r "${name}".zip "${name}"
49-
aws lambda update-function-code --function-name "${name}" --zip-file fileb://"${name}".zip
46+
publish_function(){
47+
echo "Deploying the code for ${1}"
48+
zip -r "${1}".zip "${1}"
49+
aws lambda update-function-code --function-name "${1}" --zip-file fileb://"${1}".zip
5050
}
5151

52-
update_function_layers(name){
53-
echo "Adding pip layer and custom layers to ${name}"
54-
aws lambda update-function-configuration --function-name "${name}" --layers "${INPUT_PIP_LAYER_ARN}:${PIP_LAYER_VERSION}" "${INPUT_CUSTOM_LAYER_1_ARN}:${CUSTOM_LAYER_1_VERSION}" "${INPUT_CUSTOM_LAYER_2_ARN}:${CUSTOM_LAYER_2_VERSION}" "${INPUT_CUSTOM_LAYER_3_ARN}:${CUSTOM_LAYER_3_VERSION}" "${INPUT_CUSTOM_LAYER_4_ARN}:${CUSTOM_LAYER_4_VERSION}"
52+
update_function_layers(){
53+
echo "Adding pip layer and custom layers to ${1}"
54+
aws lambda update-function-configuration --function-name "${1}" --layers "${INPUT_PIP_LAYER_ARN}:${PIP_LAYER_VERSION}" "${INPUT_CUSTOM_LAYER_1_ARN}:${CUSTOM_LAYER_1_VERSION}" "${INPUT_CUSTOM_LAYER_2_ARN}:${CUSTOM_LAYER_2_VERSION}" "${INPUT_CUSTOM_LAYER_3_ARN}:${CUSTOM_LAYER_3_VERSION}" "${INPUT_CUSTOM_LAYER_4_ARN}:${CUSTOM_LAYER_4_VERSION}"
5555
}
5656

5757
deploy_lambda_function(){
@@ -62,8 +62,8 @@ deploy_lambda_function(){
6262

6363
functionNames=(${INPUT_LAMBDA_FUNCTION_NAMES//,/ })
6464
for name in ${functionNames[@]}; do
65-
publish_function(name)
66-
update_function_layers(name)
65+
publish_function name
66+
update_function_layers name
6767
done
6868
}
6969

0 commit comments

Comments
 (0)