-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathprovision.sh
More file actions
40 lines (35 loc) · 1.08 KB
/
provision.sh
File metadata and controls
40 lines (35 loc) · 1.08 KB
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
#!/bin/bash
# Constants
SERVER_DEPLOY_PATH="/opt/P-Brain.ai"
CLIENT_DEPLOY_PATH="/opt/P-Brain.ai-client"
# Get Latest Code
git pull
# Dependencies
echo "Installing P-Brain.ai dependencies..."
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get update
sudo apt-get install -y sox libsox-fmt-all swig3.0 python-pyaudio python3-pyaudio libatlas-base-dev nodejs build-essential nodejs festival festvox-kallpc16k
sudo npm install -g node-gyp
pip install pyaudio
# Deploy
killall -KILL node
echo -ne "Done"
echo "Cloing P-Brain.ai server..."
rm -rf P-Brain.ai
rm -rf node_modules
sudo rm -rf "$CLIENT_DEPLOY_PATH"
sudo mkdir "$CLIENT_DEPLOY_PATH"
sudo cp -R ./* "$CLIENT_DEPLOY_PATH/"
git clone https://github.com/patrickjquinn/P-Brain.ai.git
sudo rm -rf "$SERVER_DEPLOY_PATH"
sudo mkdir "$SERVER_DEPLOY_PATH"
sudo cp -R ./P-Brain.ai/* "$SERVER_DEPLOY_PATH/"
# Node Dependencies
cd "$SERVER_DEPLOY_PATH"
echo "Installing P-Brain server modules..."
sudo npm install
cd "$CLIENT_DEPLOY_PATH"
echo -ne "Done"
echo "Installing P-Brain client modules..."
sudo npm install
echo -ne "Done"