Add deployment script and documentation

This commit is contained in:
2026-01-28 09:41:46 +00:00
parent ec413cb712
commit 3f3d6ef12b
2 changed files with 72 additions and 0 deletions

37
deploy.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Deployment script for Tic Tac Toe Game
# Variables
SOURCE_DIR="/home/node/clawd/tic-tac-toe-game"
TARGET_DIR="/var/www/html/tic-tac-toe" # Standard web directory
LOG_FILE="/var/log/tic-tac-toe-deploy.log"
# Log function
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOG_FILE
}
# Create target directory if it doesn't exist
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p "$TARGET_DIR"
log "Created target directory: $TARGET_DIR"
fi
# Copy files to target directory
cp -r "$SOURCE_DIR"/* "$TARGET_DIR/"
if [ $? -eq 0 ]; then
log "Successfully deployed Tic Tac Toe Game to $TARGET_DIR"
echo "Deployment completed successfully!"
echo "Game is available at: http://192.168.120.110/tic-tac-toe/"
else
log "Failed to deploy Tic Tac Toe Game"
echo "Deployment failed!"
exit 1
fi
# Set proper permissions
chmod -R 644 "$TARGET_DIR"/*
chmod -R 755 "$TARGET_DIR"
echo "Deployment process finished."