-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·46 lines (35 loc) · 1 KB
/
build.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
#!/usr/bin/env bash
if [ "$(uname)" == "Darwin" ]; then
#Macs binaries in the build aren't really supported, but can be used for testing, so adding this file to help
cp misc/setup.cfg .
fi
echo "Remove previous builds"
rm -rf build/ dist/
echo "Pull down general dependencies"
pip install -r misc/requirements.txt -t build/
echo "Adding in source code"
cp -r src/* build/
echo "build platform specific dependencies that AWS needs"
pwd="$PWD"
virtualenv builder
source ./builder/bin/activate
pushd builder
./bin/pip install cffi cryptography lxml
pushd lib64/python2.7/site-packages/
cp -r cffi* lxml* cryptography* _cffi* $pwd/build
popd
popd
deactivate
echo "Building the archive"
mkdir dist
pushd build/
zip -r9 ../dist/mdq-server.zip *
popd
rm -f setup.cfg
echo "Updating AWS Lamba service"
aws lambda update-function-code \
--function-name reloadMetadata \
--zip-file fileb://dist/mdq-server.zip
#aws lambda update-function-code \
#--function-name serveMetadata \
#--zip-file fileb://dist/mdq-server.zip