-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·54 lines (45 loc) · 1.14 KB
/
build.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
#!/bin/bash
#this script will handle the installation and rebuilding of all sub-projects of khk-web
#Joe Dailey
pwd=$(pwd)
ind="/opt/khk-web"
if [ "$pwd" != "$ind" ]; then
echo !! Projects installed to the wrong directory.
echo !! Projects must be installed to /opt/khk-web.
exit 1
fi
if [ ! -d /opt/cert ]; then
echo !! Missing /opt/cert/. These files are crucial for SSO with Google Drive.
exit 1
fi
if [ ! -d /opt/tls ]; then
echo !! Missing /opt/tls/. These files are crucial for HTTPS configuration.
exit 1
fi
echo :: Veryifying Sub-Projects are up to Date
git pull
git submodule init
git submodule update
echo :: Installing NGINX Conf
if ! which nginx > /dev/null 2>&1; then
echo !! Nginx not installed. Install and retry
exit 1
fi
sudo cp ./nginx/nginx.conf /etc/nginx/. -v
sudo mkdir /etc/nginx/sites -v
echo :: Build Sub-Projects
for D in `find . -maxdepth 1 -name "khk-*" -type d`
do
echo ""
echo ""
echo :: Installing ${D#./}
cd ${D}
if /bin/bash build.sh; then
echo :: Successfully Installed ${D#./}
else
echo !! Failed to Install ${D#./}
fi
cd ..
sudo systemctl restart nginx.service
done
/bin/bash reload-apps.sh