Skip to content

ThriveSend Documentation Auto-Sync System

Last Updated: January 26, 2026


Automated system that syncs ThriveSend B2B2G documentation changes to DocsHub whenever you commit.

What it does:

  • ✅ Automatically detects documentation changes in docs-new/
  • ✅ Syncs files to DocsHub repository
  • ✅ Rebuilds MkDocs site
  • ✅ Commits and pushes changes to GitHub
  • ✅ Updates live documentation at docs.isutech.co.za

The system runs automatically after every commit!

  1. Make changes to documentation in docs-new/
  2. Add and commit your changes:
    Terminal window
    git add docs-new/
    git commit -m "Add new screenshot"
  3. That’s it! The hook automatically:
    • Detects documentation changes
    • Syncs to DocsHub
    • Rebuilds the site
    • Pushes to GitHub

Example:

Terminal window
# Add a new screenshot
cp ~/Desktop/screenshot.png docs-new/assets/images/screenshots/02-sign-up-form.png
# Commit it
git add docs-new/assets/images/screenshots/02-sign-up-form.png
git commit -m "Add sign-up form screenshot"
# 🔄 Auto-sync runs automatically!
# You'll see output like:
# 🔄 Documentation changes detected! Starting auto-sync...
# 📋 Commit: abc123 - Add sign-up form screenshot
# [Sync process runs...]
# ✨ Sync completed successfully!

If you need to sync without committing, use the manual command:

Terminal window
# Run manual sync
/root/scripts/sync-thrivesend-docs.sh
# Or use the alias
sync-docs

When to use manual sync:

  • Testing changes before committing
  • Fixing sync issues
  • Syncing after amending commits

Terminal window
/root/scripts/sync-thrivesend-docs.sh
  • Main sync logic
  • Can be run manually
  • Used by git hook
Terminal window
/root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit
  • Runs after every commit
  • Checks if docs changed
  • Calls sync script
Terminal window
sync-docs # Convenient shortcut to run sync manually
  • Added to /root/.bashrc
  • Available in any terminal

  1. Verify Directories - Check source and target exist
  2. Sync Files - Use rsync to copy changed files
  3. Build Site - Run MkDocs build
  4. Check Changes - Git status in DocsHub repo
  5. Commit - Create commit with reference to original
  6. Push - Push to GitHub
  7. Summary - Display success message and URL

Source:

/root/projects/active/thrive-send-b2b2g/docs-new/

Target:

/var/www/docs/repo/docs/products/thrivesend-technical/

All files and directories:

  • api/ - API documentation
  • architecture/ - Architecture docs
  • assets/ - Images, diagrams, screenshots
  • compliance/ - Compliance documentation
  • deployment/ - Deployment guides
  • developer-guide/ - Developer documentation
  • getting-started/ - Getting started guides
  • technical-design/ - Technical design docs
  • user-guide/ - User guide documentation
  • index.md - Documentation homepage

  1. Take screenshot on your Mac:

    ⌘ Cmd + Shift + 4 (select area)
    ⌘ Cmd + Shift + 3 (full screen)
    ⌘ Cmd + Shift + 5 (screenshot toolbar)
  2. Save with correct filename:

    • Check the markdown file for the expected filename
    • Example: 01-landing-page.png
  3. Copy to ThriveSend repo:

    Terminal window
    cp ~/Desktop/screenshot.png \
    /root/projects/active/thrive-send-b2b2g/docs-new/assets/images/screenshots/01-landing-page.png
  4. Commit:

    Terminal window
    git add docs-new/assets/images/screenshots/01-landing-page.png
    git commit -m "Add landing page screenshot"
  5. Auto-sync runs! 🚀

    • Files copied to DocsHub
    • Site rebuilt
    • Pushed to GitHub
    • Live at docs.isutech.co.za

Check if hook is executable:

Terminal window
ls -l /root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit
# Should show: -rwxr-xr-x (executable)
# If not executable:
chmod +x /root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit

Check if docs changed:

Terminal window
# The hook only runs if docs-new/ changed
git diff-tree --no-commit-id --name-only -r HEAD | grep "docs-new/"

Check permissions:

Terminal window
ls -l /root/scripts/sync-thrivesend-docs.sh
# Should be executable
# Fix if needed:
chmod +x /root/scripts/sync-thrivesend-docs.sh

Check directories exist:

Terminal window
ls -la /root/projects/active/thrive-send-b2b2g/docs-new/
ls -la /var/www/docs/repo/docs/products/thrivesend-technical/

If GitHub push fails, you can push manually:

Terminal window
cd /var/www/docs/repo
git push origin main

Force a manual sync:

Terminal window
/root/scripts/sync-thrivesend-docs.sh

Check rsync output:

Terminal window
# Run sync script and look for file in output
/root/scripts/sync-thrivesend-docs.sh 2>&1 | grep "your-file.png"

If you need to disable automatic syncing temporarily:

Terminal window
# Rename the hook to disable it
mv /root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit \
/root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit.disabled
# Re-enable later
mv /root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit.disabled \
/root/projects/active/thrive-send-b2b2g/.git/hooks/post-commit

Terminal window
cd /root/projects/active/thrive-send-b2b2g
# Create a test file
echo "Test content" > docs-new/test-sync.md
# Commit it
git add docs-new/test-sync.md
git commit -m "Test auto-sync system"
# Watch for auto-sync output
# Should see: 🔄 Documentation changes detected!
# Clean up
git rm docs-new/test-sync.md
git commit -m "Remove test file"
Terminal window
# Run manual sync
/root/scripts/sync-thrivesend-docs.sh
# Should see full sync output with steps 1-7

No Manual Steps - Commit once, syncs everywhere ✅ Always in Sync - DocsHub always has latest docs ✅ Fast Updates - Live within seconds of commit ✅ Error Detection - Shows clear error messages ✅ Git History - Full history in both repos ✅ Safety - Only syncs if docs changed



Last Updated: January 26, 2026 Maintained By: iSu Technologies Team