-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake_lamdapackage.sh
52 lines (43 loc) · 1.5 KB
/
make_lamdapackage.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Prereq for this to work:
# virtualenv virtualenv/
# source virtualenv/bin/activate
# pip install dateparser zenpy
#pip install dateparser zenpy -t virtualenv/
OLDPATH=`pwd`
TARGET_PATH=`pwd`/build/
BUILD_FILE=$OLDPATH/lambda_deploy_package.zip
LAMBDA_FUNC_NAME=DataBotEntry
#echo $TARGET_PATH
## These command are for full rebuild only
##rm $BUILD_FILE
##rm -r $TARGET_PATH/*
##cp -r $OLDPATH/virtualenv/* $TARGET_PATH
##cp -r $OLDPATH/src/* $TARGET_PATH
##cd $TARGET_PATH
##zip -r $BUILD_FILE *
##cd $OLDPATH
cd $OLDPATH/src/
zip --exclude=*viewer* -r $BUILD_FILE *
cd $OLDPATH
## aws lambda create-function --function-name session_subscribe
## aws lambda get-function --function-name session_subscribe
lambdas=( 'databot_handle_input' 'databot_session_subscribe' 'databot_session_publish' 'databot_session_get_results' )
#lambdas=( 'databot_session_publish' )
#lambdas=( 'databot_handle_input' )
for i in "${lambdas[@]}"
do
echo "Updating " $i
aws lambda update-function-code --function-name $i --zip-file fileb://$BUILD_FILE
done
#aws lambda update-function-code --function-name $LAMBDA_FUNC_NAME --zip-file fileb://$BUILD_FILE
#cp -r $OLDPATH/virtualenv/lib/python2.7/site-packages/* $TARGET_PATH
#cp -r ~/.local/lib/python2.7/site-packages/* $TARGET_PATH
#aws lambda create-function \
#--region us-west-2 \
#--function-name helloworld \
#--zip-file fileb://file-path/helloworld.zip \
#--role service-role/DataBot \
#--handler helloworld.handler \
#--runtime python2.7 \
#--profile adminuser <== Whats this?