| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
echo "Deploying SuperFrete UI changes to development environment..." |
| 4 |
|
| 5 |
# Get the current directory |
| 6 |
CURRENT_DIR=$(pwd) |
| 7 |
|
| 8 |
# Create directories if they don't exist |
| 9 |
docker-compose exec wordpress mkdir -p /var/www/html/wp-content/plugins/superfrete/assets/styles |
| 10 |
docker-compose exec wordpress mkdir -p /var/www/html/wp-content/plugins/superfrete/assets/scripts |
| 11 |
docker-compose exec wordpress mkdir -p /var/www/html/wp-content/plugins/superfrete/templates/woocommerce |
| 12 |
docker-compose exec wordpress mkdir -p /var/www/html/wp-content/plugins/superfrete/app/Controllers |
| 13 |
|
| 14 |
# Copy the modified files to WordPress container |
| 15 |
echo "Copying template files..." |
| 16 |
docker cp templates/woocommerce/shipping-calculator.php i9-internet-superfrete-woocommerce-804b69c477ef-wordpress-1:/var/www/html/wp-content/plugins/superfrete/templates/woocommerce/ |
| 17 |
|
| 18 |
echo "Copying JavaScript files..." |
| 19 |
docker cp assets/scripts/superfrete-calculator.js i9-internet-superfrete-woocommerce-804b69c477ef-wordpress-1:/var/www/html/wp-content/plugins/superfrete/assets/scripts/ |
| 20 |
|
| 21 |
echo "Copying CSS files..." |
| 22 |
docker cp assets/styles/superfrete-calculator.css i9-internet-superfrete-woocommerce-804b69c477ef-wordpress-1:/var/www/html/wp-content/plugins/superfrete/assets/styles/ |
| 23 |
|
| 24 |
echo "Copying PHP controller files..." |
| 25 |
docker cp app/Controllers/ProductShipping.php i9-internet-superfrete-woocommerce-804b69c477ef-wordpress-1:/var/www/html/wp-content/plugins/superfrete/app/Controllers/ |
| 26 |
|
| 27 |
# Set permissions |
| 28 |
echo "Setting permissions..." |
| 29 |
docker-compose exec wordpress chown -R www-data:www-data /var/www/html/wp-content/plugins/superfrete |
| 30 |
|
| 31 |
# Clear WordPress cache |
| 32 |
echo "Clearing WordPress cache..." |
| 33 |
docker-compose exec wordpress wp cache flush --path=/var/www/html |
| 34 |
|
| 35 |
# Clear browser cache instruction |
| 36 |
echo "================================================" |
| 37 |
echo "� |
| 38 |
Deployment complete!" |
| 39 |
echo "Remember to clear your browser cache to see CSS changes." |
| 40 |
echo "You can test the changes by visiting a product page at:" |
| 41 |
echo "http://localhost:8080/?p=product_id" |
| 42 |
echo "================================================" |