@@ -23,30 +23,40 @@ publish_dependencies_as_layer(){
2323
2424publish_custom_layers (){
2525 echo " Publishing custom layer 1"
26- zip -r custom_layer_1.zip " ${INPUT_CUSTOM_LAYER_1_PATH} "
26+ cd " ${INPUT_CUSTOM_LAYER_1_PATH} "
27+ zip -r custom_layer_1.zip .
2728 local result=$( aws lambda publish-layer-version --layer-name " ${INPUT_CUSTOM_LAYER_1_ARN} " --zip-file fileb://custom_layer_1.zip)
2829 CUSTOM_LAYER_1_VERSION=$( jq ' .Version' <<< " $result" )
30+ cd ..
2931
3032 echo " Publishing custom layer 2"
31- zip -r custom_layer_2.zip " ${INPUT_CUSTOM_LAYER_2_PATH} "
33+ cd " ${INPUT_CUSTOM_LAYER_2_PATH} "
34+ zip -r custom_layer_2.zip .
3235 local result=$( aws lambda publish-layer-version --layer-name " ${INPUT_CUSTOM_LAYER_2_ARN} " --zip-file fileb://custom_layer_2.zip)
3336 CUSTOM_LAYER_2_VERSION=$( jq ' .Version' <<< " $result" )
37+ cd ..
3438
3539 echo " Publishing custom layer 3"
36- zip -r custom_layer_3.zip " ${INPUT_CUSTOM_LAYER_3_PATH} "
40+ cd " ${INPUT_CUSTOM_LAYER_3_PATH} "
41+ zip -r custom_layer_3.zip .
3742 local result=$( aws lambda publish-layer-version --layer-name " ${INPUT_CUSTOM_LAYER_3_ARN} " --zip-file fileb://custom_layer_3.zip)
3843 CUSTOM_LAYER_3_VERSION=$( jq ' .Version' <<< " $result" )
44+ cd ..
3945
4046 echo " Publishing custom layer 4"
41- zip -r custom_layer_4.zip " ${INPUT_CUSTOM_LAYER_4_PATH} "
47+ cd " ${INPUT_CUSTOM_LAYER_4_PATH} "
48+ zip -r custom_layer_4.zip .
4249 local result=$( aws lambda publish-layer-version --layer-name " ${INPUT_CUSTOM_LAYER_4_ARN} " --zip-file fileb://custom_layer_4.zip)
4350 CUSTOM_LAYER_4_VERSION=$( jq ' .Version' <<< " $result" )
51+ cd ..
4452}
4553
4654publish_function (){
4755 echo " Deploying the code for ${1} "
48- zip -r " ${1} " .zip " ${1} "
56+ cd " ${1} "
57+ zip -r " ${1} " .zip .
4958 aws lambda update-function-code --function-name " ${1} " --zip-file fileb://" ${1} " .zip
59+ cd ..
5060}
5161
5262update_function_layers (){
0 commit comments