-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
50 lines (36 loc) · 1.23 KB
/
build.sh
File metadata and controls
50 lines (36 loc) · 1.23 KB
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
#!/bin/bash
# Project config
PROJECT_ROOT=`pwd`
DIST_DIR_NAME="dist"
LAMBDA_CODE_FILE=lambda.zip
LAMBDA_FUNCTION_NAME=${LAMBDA_FUNCTION_NAME}
build() {
echo "---------------------------"
echo "Building deployment package"
echo "---------------------------"
echo ""
if [ ! -d deploy ]; then
mkdir deploy
fi
if [ ! -d ${DIST_DIR_NAME} ]; then
mkdir ${DIST_DIR_NAME}
fi
dist_path=${PROJECT_ROOT}/${DIST_DIR_NAME}
echo "Cleaning up dist and deploy directory ..."
rm -rf ${dist_path}/*
rm -rf ${PROJECT_ROOT}/deploy/*
echo "Copying project files ..."
cp -rf ${PROJECT_ROOT}/src/* ${dist_path}
echo "Adding pip libs ..."
pip3 install -r requirements.txt -t ${dist_path}/
pip install -U --index-url https://${PYSKOOCHEH_PYPI_USER}:${PYSKOOCHEH_PYPI_TOKEN}@gitlab.notofilter.com/api/v4/projects/73/packages/pypi/simple --extra-index-url https://pypi.org/simple/ pyskoocheh==${PYSKOOCHEH_VER} -t ${dist_path}/
echo "Adding google directory ..."
mkdir ${dist_path}/google
touch ${dist_path}/google/__init__.py
echo "Adding psycopg2 (Ubuntu version) ..."
cp -rf ${PROJECT_ROOT}/psy/* ${dist_path}
cd ${dist_path}
zip -r ${PROJECT_ROOT}/deploy/${LAMBDA_CODE_FILE} *
cd ${PROJECT_ROOT}
}
build