forked from globalbusinessadvisors/Agentic-Support
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
53 lines (41 loc) Β· 1.37 KB
/
deploy.sh
File metadata and controls
53 lines (41 loc) Β· 1.37 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
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Agentic Support System Deployment Script
# For Ubuntu/Debian systems
set -e
echo "π Deploying Agentic Support System..."
# Check for required tools
command -v node >/dev/null 2>&1 || { echo "Node.js is required but not installed. Aborting." >&2; exit 1; }
command -v npm >/dev/null 2>&1 || { echo "npm is required but not installed. Aborting." >&2; exit 1; }
# Install dependencies
echo "π¦ Installing dependencies..."
npm ci --production
# Build TypeScript
echo "π¨ Building TypeScript..."
npm run build
# Create required directories
echo "π Creating directories..."
mkdir -p data logs
# Set up PM2 (if not installed)
if ! command -v pm2 &> /dev/null; then
echo "π¦ Installing PM2..."
npm install -g pm2
fi
# Set up systemd service (optional)
if [ "$1" == "--systemd" ]; then
echo "βοΈ Setting up systemd service..."
pm2 startup systemd -u $USER --hp $HOME
pm2 save
fi
# Start the application
echo "π― Starting application with PM2..."
pm2 start ecosystem.config.js
# Show status
pm2 status
echo "β
Deployment complete!"
echo ""
echo "π Next steps:"
echo "1. Copy .env.example to .env and configure your settings"
echo "2. Set up GitHub webhook to http://your-server:3000/api/webhooks/github"
echo "3. Configure Gmail OAuth2 credentials"
echo "4. Run 'pm2 logs' to view application logs"
echo "5. Run 'pm2 monit' for real-time monitoring"