-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·40 lines (33 loc) · 878 Bytes
/
build.sh
File metadata and controls
executable file
·40 lines (33 loc) · 878 Bytes
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
#!/bin/bash
set -e
# run script only as root
if [ $(id -u) != 0 ]; then
echo "This script must be run as root"
exit 1
fi
# set proxy
export http_proxy="http://redacted"
export https_proxy="https://redacted"
# install required packages
apt-get update
apt-get install -y gcc python-dev python-virtualenv
# create and activate virtual environment
virtualenv venv
. venv/bin/activate
# install latest version of pip
wget -Oget-pip.py https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm -r get-pip.py
# install proper version of setuptools
pip install "setuptools==34.4.1"
pip install pybuilder
chmod +x venv/bin/pyb
pyb install_dependencies
pyb clean
pyb analyze
pyb run_unit_tests
user="${SUDO_USER:-$USER}"
group=`groups $user | awk -F' ' '{print $3}'`
# change ownership of venv and target directories
chown -R $user:$group target
chown -R $user:$group venv