1.1 changes

This commit is contained in:
buenosairesam
2025-12-29 14:17:53 -03:00
parent 11fde0636f
commit c5546cf7fc
58 changed files with 1048 additions and 496 deletions

View File

@@ -1,13 +1,13 @@
#!/bin/bash
# Deploy core_nest to server
# Deploy core_room to server
#
# Two deployment modes:
# 1. Docker (default): Full core_nest structure + source code
# 2. Bare metal (--bare-metal): Only pawprint source to systemd services
# 1. Docker (default): Full core_room structure + source code
# 2. Bare metal (--bare-metal): Only soleprint source to systemd services
#
# Usage:
# ./deploy.sh # Deploy Docker setup (default)
# ./deploy.sh --bare-metal # Deploy bare metal pawprint only
# ./deploy.sh --bare-metal # Deploy bare metal soleprint only
# ./deploy.sh --dry-run # Preview what would be synced
# ./deploy.sh --bare-metal --dry-run # Preview bare metal sync
@@ -18,13 +18,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/.env.sync" 2>/dev/null || true
SERVER="${DEPLOY_SERVER:-mariano@mcrn.ar}"
REMOTE_PATH="${DEPLOY_REMOTE_PATH:-~/core_nest}"
BARE_METAL_PATH="${DEPLOY_BARE_METAL_PATH:-~/pawprint}"
REMOTE_PATH="${DEPLOY_REMOTE_PATH:-~/core_room}"
BARE_METAL_PATH="${DEPLOY_BARE_METAL_PATH:-~/soleprint}"
# Source code paths (defaults if not in .env.sync)
LOCAL_AMAR_BACKEND="${LOCAL_AMAR_BACKEND:-$HOME/wdir/ama/amar_django_back}"
LOCAL_AMAR_FRONTEND="${LOCAL_AMAR_FRONTEND:-$HOME/wdir/ama/amar_frontend}"
LOCAL_PAWPRINT="${LOCAL_PAWPRINT:-$HOME/wdir/ama/pawprint}"
LOCAL_SOLEPRINT="${LOCAL_SOLEPRINT:-$HOME/wdir/ama/soleprint}"
DRY_RUN=""
BARE_METAL=""
@@ -48,15 +48,15 @@ if [ -n "$BARE_METAL" ]; then
echo "=== Deploying to Bare Metal (Systemd Services) ==="
echo ""
# Only sync pawprint source
if [ -d "$LOCAL_PAWPRINT" ] && [ -f "$LOCAL_PAWPRINT/main.py" ]; then
echo "Syncing pawprint source to bare metal..."
# Only sync soleprint source
if [ -d "$LOCAL_SOLEPRINT" ] && [ -f "$LOCAL_SOLEPRINT/main.py" ]; then
echo "Syncing soleprint source to bare metal..."
$RSYNC_CMD $DRY_RUN \
"$LOCAL_PAWPRINT/" \
"$LOCAL_SOLEPRINT/" \
"$SERVER:$BARE_METAL_PATH/"
echo "Pawprint synced to $BARE_METAL_PATH"
echo "Soleprint synced to $BARE_METAL_PATH"
else
echo "Pawprint not found at: $LOCAL_PAWPRINT"
echo "Soleprint not found at: $LOCAL_SOLEPRINT"
exit 1
fi
echo ""
@@ -70,10 +70,10 @@ if [ -n "$BARE_METAL" ]; then
echo ""
echo "Next steps on server (as mariano user):"
echo " Restart systemd services:"
echo " sudo systemctl restart pawprint artery album ward"
echo " sudo systemctl restart soleprint artery album ward"
echo ""
echo " Check status:"
echo " sudo systemctl status pawprint artery album ward"
echo " sudo systemctl status soleprint artery album ward"
echo ""
exit 0
fi
@@ -84,13 +84,13 @@ fi
echo "=== Deploying to Docker ==="
echo ""
# 1. Sync core_nest structure (excluding src directories - they're synced separately)
echo "1. Syncing core_nest structure..."
# 1. Sync core_room structure (excluding src directories - they're synced separately)
echo "1. Syncing core_room structure..."
$RSYNC_CMD $DRY_RUN \
--exclude='*/src/' \
./ \
"$SERVER:$REMOTE_PATH/"
echo " [OK] Core nest structure synced"
echo " [OK] Core room structure synced"
echo ""
# 2. Sync amar backend source
@@ -117,15 +117,15 @@ else
fi
echo ""
# 4. Sync pawprint source
if [ -d "$LOCAL_PAWPRINT" ] && [ -f "$LOCAL_PAWPRINT/main.py" ]; then
echo "4. Syncing pawprint source..."
# 4. Sync soleprint source
if [ -d "$LOCAL_SOLEPRINT" ] && [ -f "$LOCAL_SOLEPRINT/main.py" ]; then
echo "4. Syncing soleprint source..."
$RSYNC_CMD $DRY_RUN \
"$LOCAL_PAWPRINT/" \
"$SERVER:$REMOTE_PATH/pawprint/src/"
echo " [OK] Pawprint synced"
"$LOCAL_SOLEPRINT/" \
"$SERVER:$REMOTE_PATH/soleprint/src/"
echo " [OK] Soleprint synced"
else
echo "4. [INFO] Pawprint not found at: $LOCAL_PAWPRINT"
echo "4. [INFO] Soleprint not found at: $LOCAL_SOLEPRINT"
fi
echo ""