-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·63 lines (51 loc) · 1.81 KB
/
deploy.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.81 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
54
55
56
57
58
59
60
61
#!/bin/bash
#
# Core Cast Server - Docker Deployment Script (Password Version)
#
# This script securely syncs the application source code from the
# local './server' directory to the '~/corecast-server' directory
# on the remote server, then triggers a Docker Compose build and restart.
#
# !! IMPORTANT !!
# This version does NOT use SSH keys and will prompt you
# for your server password multiple times.
#
# --- Configuration ---
# ▼▼▼ EDIT THESE VALUES ▼▼▼
# Set the SSH user and IP address of your remote server
SERVER_USER="evan"
SERVER_IP="192.168.1.213"
# Set the local subdirectory containing your Docker code
# (This script assumes it's run from the project root)
PROJECT_DIR_LOCAL="./"
# Set the directory on the server where the project will be deployed
# (User's home directory, as you requested)
PROJECT_DIR_REMOTE="~/corecast-server-setup"
# --- End Configuration ---
# 'set -e' makes the script exit immediately if any command fails
set -e
# --- Step 1: Sync Files ---
echo "🚀 Syncing Core Cast server files to $SERVER_USER@$SERVER_IP..."
echo " Local source: $PROJECT_DIR_LOCAL"
echo " Remote destination: $PROJECT_DIR_REMOTE"
echo " (You will be prompted for your password for the file sync...)"
# The trailing slash on '$PROJECT_DIR_LOCAL/' is CRITICAL.
# It tells rsync to copy the *contents* of the 'server' directory,
# not the directory itself.
#
# We remove the '-e "ssh -i $SERVER_SSH_KEY"' part to allow
# rsync to use password authentication.
rsync -avzP \
--delete \
--exclude=".git/" \
--exclude="deploy.sh" \
--exclude="*.pyc" \
--exclude="__pycache__/" \
--exclude="test.py" \
"$PROJECT_DIR_LOCAL" \
"$SERVER_USER@$SERVER_IP:$PROJECT_DIR_REMOTE/"
if [ $? -ne 0 ]; then
echo "❌ Rsync failed. Aborting."
exit 1
fi
echo "✅ File sync complete."