blob: 51a4cbb67c8055491afddf9078fab51372d59699 (
plain)
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
53
54
55
56
57
58
59
60
|
#!/bin/bash
echo "Checking package"
which mypy > /dev/null
if [ $? -eq 0 ]
then
mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ src/soc_collector/*.py || exit 1
fi
which black > /dev/null
if [ $? -eq 0 ]
then
black --line-length 120 src/soc_collector/*.py # || exit 1
fi
which pylint > /dev/null
if [ $? -eq 0 ]
then
pylint --max-line-length 120 src/soc_collector/*.py # || exit 1
fi
echo "Checking tests"
which mypy > /dev/null
if [ $? -eq 0 ]
then
mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ tests/*.py || exit 1
fi
which black > /dev/null
if [ $? -eq 0 ]
then
black --line-length 120 tests/*.py # || exit 1
fi
which pylint > /dev/null
if [ $? -eq 0 ]
then
pylint --max-line-length 120 tests/*.py # || exit 1
fi
# Stop the containers
docker-compose down --remove-orphans
# Set data ownership
mkdir -p data/mongodb_data
sudo chown -R "$USER" data/mongodb_data
# Build containers
docker-compose -f docker-compose.yml build
# Set data ownership
sudo chown -R 101 data/mongodb_data
# Run and deploy containers
docker-compose -f docker-compose.yml up -d
sleep 3
echo "Running tests"
python3 -m unittest
|