Permalink
Browse files

Add the 'publish' target to update the Lambda function

  • Loading branch information...
1 parent 8fa581d commit 1edeaca0ad85806a20947ff1df688e660f7f447e @adomokos committed May 30, 2016
Showing with 7 additions and 2 deletions.
  1. +7 −2 Makefile
View
@@ -41,9 +41,9 @@ package: ## Package the code for AWS Lambda
@cp resources/wrapper.sh $(LAMBDADIR)/hello
@chmod +x $(LAMBDADIR)/hello
@cp resources/index.js $(LAMBDADIR)/
- @cd $(LAMBDADIR) && zip -r hello_ruby.zip hello index.js lib/
+ @cd $(LAMBDADIR) && zip -r hello_ruby.zip hello index.js lib/ > /dev/null
@mkdir deploy
- cd $(LAMBDADIR) && mv hello_ruby.zip ../deploy/
+ @cd $(LAMBDADIR) && mv hello_ruby.zip ../deploy/
@echo '... Done.'
create: ## Creates an AWS lambda function
@@ -57,6 +57,11 @@ create: ## Creates an AWS lambda function
--role arn:aws:iam::___xyz___:role/lambda_basic_execution \
--zip-file fileb://./deploy/hello_ruby.zip
+publish: package ## Deploys the latest version to AWS
+ aws lambda update-function-code \
+ --function-name HelloFromRuby \
+ --zip-file fileb://./deploy/hello_ruby.zip
+
delete: ## Removes the Lambda
aws lambda delete-function --function-name HelloFromRuby

0 comments on commit 1edeaca

Please sign in to comment.