EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
wordpress-deployment-package Directory Reference

Detailed Description

WordPress Deployment Package

Contents of this directory should be added to each WordPress GitHub repository.

Files Included

  1. create-wp-config-from-env.php - Auto-generates wp-config.php from environment variables
  2. .do/deploy.sh - DigitalOcean App Platform pre-deploy hook
  3. .gitignore - Prevents wp-config.php from being committed

Installation Steps

For each WordPress site repository (e.g., Independent-Business-Group/wordpress-performwritecom):

1. Add Files to Repository

# Copy these files to the root of the repository:
cp create-wp-config-from-env.php <repo-root>/
cp -r .do <repo-root>/
cat .gitignore >> <repo-root>/.gitignore

2. Commit and Push

cd <repo-root>
git add create-wp-config-from-env.php .do/ .gitignore
git commit -m "Add auto-generated wp-config from environment variables"
git push origin main

3. Auto-Deploy

DigitalOcean App Platform will:

  1. Pull the latest code from GitHub
  2. Run .do/deploy.sh before starting the app
  3. Generate wp-config.php from environment variables
  4. Start the WordPress app with the correct configuration

What Happens During Deployment

  1. Pre-Deploy Hook Runs (.do/deploy.sh):
    • Executes create-wp-config-from-env.php
    • Generates wp-config.php with:
      • Database credentials from env vars (isolated user per site)
      • Auto-detected table prefix from database
      • Dynamic URL detection (App Platform vs production domain)
      • Unique security keys from WordPress API
      • SSL connection settings
      • Debug mode based on environment
  2. App Starts:

Environment Variables (Already Configured)

Each app already has these environment variables set in DigitalOcean App Platform:

  • DB_NAME - Database name (e.g., performwritecom_wp)
  • DB_USER - Isolated database user (e.g., performwritecom_user)
  • DB_PASSWORD - User password (encrypted secret)
  • DB_HOST - MySQL cluster host
  • DB_PORT - MySQL port (25060)

The script auto-generates wp-config.php from these variables on every deployment.

Sites Ready for Deployment

Site GitHub Repo Status
performwritecom Independent-Business-Group/wordpress-performwritecom ✅ Ready
sfnm Independent-Business-Group/wordpress-sfnm ✅ Ready
redheale Independent-Business-Group/wordpress-redheale ✅ Ready
path2ucom Independent-Business-Group/wordpress-path2ucom ✅ Ready
outdoor1 Independent-Business-Group/wordpress-outdoor1 ✅ Ready
murwillu Independent-Business-Group/wordpress-murwillu ✅ Ready
murbahmowers Independent-Business-Group/wordpress-murbahmowers ✅ Ready
laserxperts Independent-Business-Group/wordpress-laserxperts ✅ Ready
kandudeliveriesc Independent-Business-Group/wordpress-kandudeliveriesc ✅ Ready
handsofd Independent-Business-Group/wordpress-handsofd ✅ Ready
corne582 Independent-Business-Group/wordpress-corne582 ✅ Ready
collegeo Independent-Business-Group/wordpress-collegeo ⚠️ App needs ingress fix first

Verification After Deployment

After pushing to each repo, verify the deployment:

# Check deployment logs
doctl apps logs <app-id> --tail 50
# Test the site
curl -I https://<app-url>.ondigitalocean.app
# Should return HTTP 200, not redirect to install.php

What We've Completed

Database Security:

Database URLs:

  • Updated all 11 deployed sites to use App Platform URLs
  • No more install.php redirects (once wp-config is deployed)

wp-config Generation:

  • Created auto-generation script
  • Reads environment variables
  • Detects table prefixes automatically
  • Generates unique security keys
  • Dynamic URL handling

What's Next

  1. Add files to GitHub repos (this package)
  2. Monitor deployments as App Platform rebuilds
  3. Test each site to confirm they work
  4. Fix collegeo app (no ingress configured)
  5. Deploy 4 missing apps (coomerawatersrea, pits, soilife, vastcons)
  6. Migrate DNS to production domains (after testing)

Created: 2026-02-17
Last Updated: 2026-02-17
Location: /home/cw/Documents/IBG_HUB/rmm-psa-devops/wordpress-deployment-package/