-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·42 lines (29 loc) · 971 Bytes
/
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
#!/usr/bin/env bash
file_prefix="lambda_data_warehouse-v"
# ask user to input a version number
echo "Enter a version number to build: "
read -r version
# make a directory with the version number
mkdir "$version"
# copy the source files from the src directory to the new directory
cp -r src/* "$version"/
# change into the new directory
cd "$version" || exit
# create a python environment in the directory
python3 -m venv env
# activate the python environment
# shellcheck source=/dev/null
source env/bin/activate
# install the requirements from the requirements.txt file
pip install -r requirements.txt -t ./
# deactivate the python environment
deactivate
# remove the bin and lib folders created by the python environment
rm -rf env
# archive all files in the new directory to a zip file
zip -q -r "../$file_prefix$version.zip" .
# remove the new directory
cd ..
rm -rf "$version"
echo ""
echo "Finished building, release file is: $file_prefix$version.zip"