update deployment script

This commit is contained in:
Casey 2026-01-08 07:25:13 -06:00
parent 1bc4ce4810
commit 404389d95a

View File

@ -41,7 +41,33 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
-h|--help)
echo "Usage: $0 [--tag <string>] [--remote-host <host>] [--remote-user <user>]"
echo "Usage: $0 --tag <version> [OPTIONS]"
echo ""
echo "Automated Build & Deploy Script for Brotherton Frappe Docker"
echo "--------------------------------------------------------"
echo ""
echo "description:"
echo " This script orchestrates the full deployment pipeline. It first validates that"
echo " the requested tag does not already exist locally, remotely, or in the registry."
echo " It then builds the Docker image, pushes it to the registry, and triggers the"
echo " remote deployment script."
echo ""
echo "Remote Deployment Actions (executed on server via re-deploy.sh):"
echo " 1. Updates 'frappe-compose.yml' with the new image tag (preserves backup)."
echo " 2. Restarts containers to load the new image."
echo " 3. Runs 'bench migrate' (only if --migrate is passed)."
echo " 4. Compiles assets via 'bench build' and 'bench build-frontend'."
echo " 5. cleanup: Removes old images (Patch Version - 2) to save space."
echo " 6. RECOVERY: If any step fails, it automatically rolls back config and containers."
echo ""
echo "Options:"
echo " --tag <string> REQUIRED. Version tag for the image (e.g., 1.0.0)."
echo " --migrate Run 'bench migrate' on the remote server."
echo " --build-only Build and push only; skip remote deployment checks & action."
echo " --remote-host <host> Target server (Default: $REMOTE_HOST)."
echo " --remote-user <user> SSH User (Default: $REMOTE_USER)."
echo " -h, --help Show this help message."
echo ""
exit 0
;;
--build-only)