Skip to content

Commit 6a38142

Browse files
authored
Merge pull request #132 from odedniv/makefile
restore old Makefile
2 parents 9924bc1 + bcf698e commit 6a38142

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.PHONY: clean configtest
2+
3+
lambda:
4+
npm install .
5+
@echo "Factory package files..."
6+
@if [ ! -d build ] ;then mkdir build; fi
7+
@cp index.js build/index.js
8+
@cp config.json build/config.json
9+
@if [ -d build/node_modules ] ;then rm -rf build/node_modules; fi
10+
@cp -R node_modules build/node_modules
11+
@cp -R lib build/
12+
@cp -R bin build/
13+
@rm -rf build/bin/darwin
14+
@echo "Create package archive..."
15+
@cd build && zip -rq aws-lambda-image.zip .
16+
@mv build/aws-lambda-image.zip ./
17+
18+
uploadlambda: lambda
19+
@if [ -z "${LAMBDA_FUNCTION_NAME}" ]; then (echo "Please export LAMBDA_FUNCTION_NAME" && exit 1); fi
20+
aws lambda update-function-code --function-name ${LAMBDA_FUNCTION_NAME} --zip-file fileb://aws-lambda-image.zip
21+
22+
configtest:
23+
@./bin/configtest
24+
25+
clean:
26+
@echo "clean up package files"
27+
@if [ -f aws-lambda-image.zip ]; then rm aws-lambda-image.zip; fi
28+
@rm -rf build/*

0 commit comments

Comments
 (0)