-
Notifications
You must be signed in to change notification settings - Fork 219
/
Makefile
28 lines (24 loc) · 868 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: clean configtest
lambda:
npm install .
@echo "Factory package files..."
@if [ ! -d build ] ;then mkdir build; fi
@cp index.js build/index.js
@cp config.json build/config.json
@if [ -d build/node_modules ] ;then rm -rf build/node_modules; fi
@cp -R node_modules build/node_modules
@cp -R lib build/
@cp -R bin build/
@rm -rf build/bin/darwin
@echo "Create package archive..."
@cd build && zip -rq aws-lambda-image.zip .
@mv build/aws-lambda-image.zip ./
uploadlambda: lambda
@if [ -z "${LAMBDA_FUNCTION_NAME}" ]; then (echo "Please export LAMBDA_FUNCTION_NAME" && exit 1); fi
aws lambda update-function-code --function-name ${LAMBDA_FUNCTION_NAME} --zip-file fileb://aws-lambda-image.zip
configtest:
@./bin/configtest
clean:
@echo "clean up package files"
@if [ -f aws-lambda-image.zip ]; then rm aws-lambda-image.zip; fi
@rm -rf build/*