-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·42 lines (32 loc) · 1.03 KB
/
deploy.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.03 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
41
42
#!/bin/bash
echo "Starting deployment process..."
# Stop PM2 process
echo "Stopping PM2 process..."
pm2 stop maucoding-web
# Download from repo
echo "Downloading from repository..."
git clone git@github.com:yna-studio/maucoding-web-v2.2.git --branch main --single-branch /tmp/maucoding-web-v2.2-deploy
# Move to apps directory
echo "Moving to apps directory..."
rm -rf /root/apps/maucoding-web-v2.2
mkdir -p /root/apps
mv /tmp/maucoding-web-v2.2-deploy /root/apps/maucoding-web-v2.2
# Create .env file
echo "Creating .env file..."
cat > /root/apps/maucoding-web-v2.2/.env << EOF
PRIVATE_MCDG_BE_HOST=http://103.161.185.25:19091
PUBLIC_MCDG_WEB_HOST=https://maucoding.com
PRIVATE_APP_KEY=oopsreview-development
EOF
# Change to app directory
cd /root/apps/maucoding-web-v2.2
# Install dependencies
echo "Installing dependencies..."
pnpm install
# Build application
echo "Building application..."
pnpm build
# Restart PM2
echo "Restarting PM2..."
pm2 start maucoding-web --name maucoding-web-v2.2 -- -- 20262
echo "Deployment completed successfully!"