-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy_script.sh
44 lines (35 loc) · 1013 Bytes
/
deploy_script.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
#!/bin/bash
# Check if the VitsServer directory already exists
if [ -d "VitsServer" ]; then
echo "VitsServer directory already exists, updating..."
cd VitsServer
git pull --exclude=.env --exclude=model
exit
else
# Clone the repository
git clone https://github.com/LlmKira/VitsServer.git
cd VitsServer
fi
# Update system packages
sudo apt-get update &&
sudo apt-get install -y build-essential libsndfile1 vim gcc g++ cmake
# Install Python dependencies
sudo apt install python3-pip
pip3 install pipenv
# Install dependency packages
pipenv install
# Activate the virtual environment
pipenv shell
# Set up the configuration file
touch .env
echo "VITS_SERVER_HOST=0.0.0.0" > .env
echo "VITS_SERVER_PORT=9557" >> .env
echo "VITS_SERVER_RELOAD=false" >> .env
# Start the server using PM2
sudo apt install npm
npm install pm2 -g
pm2 start pm2.json --name vits_server --watch
# Save the PM2 process list so it will be started at boot
sudo pm2 save
# Exit the virtual environment
exit