2d4b9412cd93 — Duncan Ross Palmer tip 1 year, 1 day ago
aww yeah, it works
2 files changed, 12 insertions(+), 5 deletions(-)

M Makefile
M handler.pl
M Makefile +11 -5
@@ 1,17 1,19 @@ 
 #!/usr/bin/env make -f
 
 FUNCTION="hello-universe"
+REGION=eu-west-2
+PROFILE=default
 
 all : handler.zip
 
 clean:
-	rm handler.zip
+	rm -f handler.zip
 
-handler.zip : handler.pl
-	zip handler.zip handler.pl
+handler.zip: FORCE
+	zip --recurse-paths handler.zip lib handler.pl
 
 publish : all
-	aws --region eu-west-2 --profile default lambda create-function \
+	aws --region ${REGION} --profile ${PROFILE} lambda create-function \
 		--function-name ${FUNCTION} \
 		--zip-file "fileb://handler.zip" \
 		--handler "handler.handle" \

          
@@ 20,6 22,10 @@ publish : all
 		--layers "arn:aws:lambda:eu-west-2:445285296882:layer:perl-5-28-runtime:11"
 
 update : all
-	aws --region eu-west-2 --profile default lambda update-function-code \
+	aws --region ${REGION} --profile ${PROFILE} lambda update-function-code \
 		--function-name ${FUNCTION} \
 		--zip-file fileb://handler.zip
+
+FORCE:
+
+.PHONY: update publish clean all

          
M handler.pl +1 -0
@@ 1,6 1,7 @@ 
 #!/usr/bin/env perl
 
 package main;
+use lib './lib';
 use strict;
 use warnings;