-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
59 lines (50 loc) · 1.16 KB
/
install.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
53
54
55
56
57
58
59
#!/bin/bash
#
# Owner : LPauzies
# Email : [email protected]
# Setup global variables for the installation
## Owner
owner=LPauzies
## Repos
db=home-network-monitoring-database
etl=home-network-monitoring-etl
api=home-network-monitoring-api
ui=home-network-monitoring-ui
clone_if_not_exists() {
if [[ ! -d "$1" ]]
then
git clone https://github.com/$owner/$1.git
else
echo "Folder already exists. Aborted."
exit
fi
}
python_source_activate=.venv/Scripts/activate
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];
then
python_source_activate=.venv/bin/activate
fi
# Database part
clone_if_not_exists $db
# ETL part
clone_if_not_exists $etl
cd home-network-monitoring-etl
python -m venv .venv
source $python_source_activate
python -m pip install --upgrade pip
pip install -r requirements.txt
cd ..
# API part
clone_if_not_exists $api
cd home-network-monitoring-api
python -m venv .venv
source $python_source_activate
python -m pip install --upgrade pip
pip install -r requirements.txt
cd ..
# UI part
clone_if_not_exists $ui
cd home-network-monitoring-ui/ui
npm install --silent --no-optional
cd ../..
echo "Installation done."