#!/bin/bash # Enhanced Template Deployment Add-on Script # Run this after main plugin deployment to deploy enhanced TEC template set -e # Source environment variables source .env echo "๐Ÿš€ Deploying Enhanced TEC Template to Theme Directory..." # Get server connection details SERVER_IP="$UPSKILL_STAGING_IP" SSH_USER="$UPSKILL_STAGING_SSH_USER" SERVER_PATH="$UPSKILL_STAGING_PATH" # Get SSH password from environment SSH_PASS="$UPSKILL_STAGING_PASS" if [ -z "$SSH_PASS" ]; then echo "Error: SSH password not found in environment variables" exit 1 fi # Deploy enhanced template and partials to theme directory echo "๐Ÿ“ Creating theme directory structure on server..." sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SERVER_IP" " cd $SERVER_PATH && mkdir -p wp-content/themes/astra-child-hvac/tribe-events/community/partials && echo 'โœ… Theme directories created' " echo "๐Ÿ“„ Deploying enhanced TEC template..." sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SERVER_IP" " cd $SERVER_PATH && cp wp-content/plugins/hvac-community-events/templates/community-edit-event-enhanced.php wp-content/themes/astra-child-hvac/tribe-events/community/edit-event.php && echo 'โœ… Enhanced template deployed' " echo "๐Ÿ”ง Deploying field partials..." sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SERVER_IP" " cd $SERVER_PATH && cp wp-content/plugins/hvac-community-events/templates/partials/excerpt-field.php wp-content/themes/astra-child-hvac/tribe-events/community/partials/ && cp wp-content/plugins/hvac-community-events/templates/partials/categories-field.php wp-content/themes/astra-child-hvac/tribe-events/community/partials/ && cp wp-content/plugins/hvac-community-events/templates/partials/featured-image-field.php wp-content/themes/astra-child-hvac/tribe-events/community/partials/ && cp wp-content/plugins/hvac-community-events/templates/partials/tags-field.php wp-content/themes/astra-child-hvac/tribe-events/community/partials/ && echo 'โœ… Field partials deployed' " echo "๐Ÿ”’ Setting file permissions..." sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SERVER_IP" " cd $SERVER_PATH && chmod 644 wp-content/themes/astra-child-hvac/tribe-events/community/edit-event.php && chmod 644 wp-content/themes/astra-child-hvac/tribe-events/community/partials/*.php && echo 'โœ… Permissions set' " echo "โœ… Verifying deployment..." sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SERVER_IP" " cd $SERVER_PATH && echo '๐Ÿ“‹ Enhanced Template Files:' && ls -la wp-content/themes/astra-child-hvac/tribe-events/community/ && echo '๐Ÿ“‹ Field Partials:' && ls -la wp-content/themes/astra-child-hvac/tribe-events/community/partials/ " echo "" echo "๐ŸŽ‰ Enhanced TEC Template Deployment Complete!" echo "" echo "๐Ÿ“‹ Deployment Summary:" echo "- Enhanced template: /wp-content/themes/astra-child-hvac/tribe-events/community/edit-event.php" echo "- Field partials: /wp-content/themes/astra-child-hvac/tribe-events/community/partials/ (4 files)" echo "" echo "๐Ÿ”— Test URL: https://upskill-staging.measurequick.com/?events-community=add" echo "" echo "๐Ÿ“ Expected Enhanced Features:" echo "- โœ“ Event excerpt field with character counter" echo "- โœ“ Categories multi-select with search functionality" echo "- โœ“ Featured image upload with WordPress media library" echo "- โœ“ Tags with autocomplete and popular suggestions" echo "- โœ“ Enhanced responsive design and accessibility" echo "" echo "๐Ÿงช Run test: node test-enhanced-field-deployment.js"