-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
48 lines (39 loc) · 1.28 KB
/
startup.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
echo "WebAll Docker Container"
echo "Starting MySQL..."
systemctl start mysql > /dev/null 2>&1
echo "Starting Apache Web Server..."
systemctl start apache2 > /dev/null 2>&1
if [ ! -d ./WebAll-Widget-Server ]
then
echo "Setting MySQL root user..."
mysql -u root < setup-files/init.sql > /dev/null 2>&1
echo "Downloading NodeJS version manager (n)..."
npm i -g n > /dev/null 2>&1
echo "Downloading latest NodeJS version..."
n latest > /dev/null 2>&1
echo "Cleaning /var/www/html..."
rm -rf /var/www/html > /dev/null 2>&1
echo "Cloning WebAll Widget Server git repository..."
git clone https://github.com/WebAll-Accessibility/WebAll-Widget-Server > /dev/null 2>&1
fi
echo "Cloning WebAll Website git repository..."
rm -rf /var/www/html > /dev/null 2>&1
git clone https://github.com/WebAll-Accessibility/WebAll-Website /var/www/html > /dev/null 2>&1
ln -s /var/www/html ./WebAll-Website
cd WebAll-Widget-Server
if [ ! -f db/created ]
then
echo "Creating database..."
bash setup.sh root > /dev/null 2>&1
echo "Installing NodeJS packages..."
cd src/
npm i > /dev/null 2>&1
cd ..
fi
echo "Copying ENV file to destination..."
cp ../setup-files/wws-env ./src/.env
echo "Starting Weball Widget Server..."
bash run.sh
cd ..
echo "All done!"
bash