forked from ttu/ruuvitag-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verification.sh
executable file
·52 lines (45 loc) · 998 Bytes
/
verification.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
47
48
49
50
51
52
#!/bin/bash
rm -rf venv_py3
rm -rf venv_py2
python3 -m venv venv_py3
source venv_py3/bin/activate
if [ "$1" = "pypi" ]; then
python3 -m pip install ruuvitag_sensor
else
python3 -m pip install -e .
fi
if [ "$RUUVI_BLE_ADAPTER" = "Bleson" ]; then
python3 -m pip install git+https://github.com/TheCellule/python-bleson
fi
python3 verification.py
ret=$?
if [ $ret -ne 0 ]; then
echo 'Python 3 verification failed'
rm -rf venv_py3
exit 1
fi
deactivate
rm -rf venv_py3
if [ "$RUUVI_BLE_ADAPTER" = "Bleson" ]; then
echo 'Python 2 verification not executed for Bleson'
echo 'VERIFICATION COMPLETED'
exit 0
fi
virtualenv --python=/usr/bin/python2.7 venv_py2
source venv_py2/bin/activate
if [ "$1" = "pypi" ]; then
pip install ruuvitag_sensor
else
pip install -e .
fi
python verification.py
ret=$?
if [ $ret -ne 0 ]; then
echo 'Python 2.7 verification failed'
rm -rf venv_py2
exit 1
fi
deactivate
rm -rf venv_py2
echo '----------------------'
echo 'VERIFICATION COMPLETED'