#!/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."