diff --git a/script/deploy_shell.sh b/script/deploy_shell.sh new file mode 100644 index 0000000..99fdc36 --- /dev/null +++ b/script/deploy_shell.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Deploy sage shell files to production wwwroot +# Usage: bash ~/sage/script/deploy_shell.sh +# +# This script copies index.ui and global_menu.ui from the git repo +# to the production wwwroot directory (which is gitignored). + +set -e + +SAGE_DIR="${SAGE_HOME:-$HOME/sage}" +SAGE_WWWROOT="$SAGE_DIR/wwwroot" +SAGE_REPO="$HOME/repos/sage/wwwroot" + +echo "Deploying sage shell files..." +echo "Source: $SAGE_REPO" +echo "Target: $SAGE_WWWROOT" +echo "" + +# Ensure wwwroot exists +mkdir -p "$SAGE_WWWROOT" + +# Copy index.ui +if [ -f "$SAGE_REPO/index.ui" ]; then + cp "$SAGE_REPO/index.ui" "$SAGE_WWWROOT/index.ui" + echo "✓ index.ui (Shell layout with sidebar)" +else + echo "✗ index.ui not found in $SAGE_REPO" + exit 1 +fi + +# Copy global_menu.ui +if [ -f "$SAGE_REPO/global_menu.ui" ]; then + cp "$SAGE_REPO/global_menu.ui" "$SAGE_WWWROOT/global_menu.ui" + echo "✓ global_menu.ui (Global navigation menu)" +else + echo "✗ global_menu.ui not found in $SAGE_REPO" + exit 1 +fi + +# Remove old symlinks if exist +rm -f "$SAGE_WWWROOT/dashboard_for_sage" 2>/dev/null || true + +echo "" +echo "Deployed to $SAGE_WWWROOT/" +echo "" +echo "Next steps:" +echo " 1. cd ~/repos/dashboard_for_sage && git pull" +echo " 2. cd ~/repos/bricks && git pull && bash build.sh" +echo " 3. cd ~/sage && ./stop.sh && ./start.sh"