File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 3
3
# directory used for deployment
4
4
export DEPLOY_DIR=lambda
5
5
6
- echo Creating deploy package
6
+ # Get Python version
7
+ PYVERSION=$( cat /root/.pyenv/version)
8
+ MAJOR=${PYVERSION%% .* }
9
+ MINOR=${PYVERSION#* .}
10
+ PYVER=${PYVERSION%% .* }${MINOR%% .* }
11
+ PYPATH=/root/.pyenv/versions/$PYVERSION /lib/python3.6/site-packages/
7
12
8
- EXCLUDE=" boto3* botocore* pip* docutils* *.pyc setuptools* wheel* coverage* testfixtures* mock* *.egg-info *.dist-info"
13
+ echo Creating deploy package for Python $PYVERSION
14
+
15
+ EXCLUDE=" boto3* botocore* pip* docutils* *.pyc setuptools* wheel* coverage* testfixtures* mock* *.egg-info *.dist-info __pycache__ easy_install.py"
9
16
10
17
EXCLUDES=()
11
18
for E in ${EXCLUDE}
12
19
do
13
- echo ${E}
14
20
EXCLUDES+=(" --exclude ${E} " )
15
21
done
16
22
17
- rsync -ax $PREFIX /lib/python$PYVER /site-packages/ $DEPLOY_DIR / ${EXCLUDES[@]}
18
- rsync -ax $PREFIX /lib64/python$PYVER /site-packages/ $DEPLOY_DIR / ${EXCLUDES[@]}
23
+ rsync -ax $PYPATH / $DEPLOY_DIR / ${EXCLUDES[@]}
19
24
20
25
# zip up deploy package
21
26
cd $DEPLOY_DIR
You can’t perform that action at this time.
0 commit comments