-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
64 lines (57 loc) · 1.3 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
60
61
62
63
64
#!/bin/bash
ENVI=;
LPATH=;
if [[ 1 -gt $# ]]; then
echo "Please specify the desired install configuration for the environment."
echo " - (l) Local"
echo " - (d) Dev"
echo " - (q) QA"
echo " - (p) Production"
read -p "Environment (l/d/q/p): " ENVI
echo;
else
ENVI=$1
fi
case "$ENVI" in
l)
LPATH="/env/local/bin"
;;
d)
LPATH="/env/dev/bin"
;;
q)
LPATH="/env/qa/bin"
;;
p)
LPATH="/env/prod/bin"
;;
*)
echo $"Usage: $0 {l|d|q|p}"
echo " - (l) Env = Local"
echo " - (d) Env = Dev"
echo " - (q) Env = QA"
echo " - (p) Env = Production"
exit 1
;;
esac
ln -s "$PWD$LPATH/start.sh" ./bin/startComponents.sh
LINK1S=$?
ln -s "$PWD$LPATH/stop.sh" ./bin/stopComponents.sh
LINK2S=$?
if [[ $LINK1S -ne 0 || $LINK2S -ne 0 ]]; then
echo "FATAL: Problem creating symlinks!"
exit 1
fi
npm --prefix ./server install ./server
N1S=$?
npm --prefix ./web install ./web
N2S=$?
if [[ $N1S -ne 0 || $N2S -ne 0 ]]; then
echo "FATAL: Problem installing npm packages! Please install packages before starting components"
exit 1
fi
echo;
echo "~~~~~ Web and Server components installed! ~~~~~"
echo "!! Please make sure that MongoDB is installed !!"
echo "!! on the OS before using DB scripts or !!"
echo "!! starting components !!"