Harden create-site deploy logs and Coolify env compatibility

Filter more bench install noise, set CI=1 to reduce progress spam, and
rely on compose defaults for SITE_NAME/FRAPPE_SITE_NAME_HEADER instead
of literal ${SERVICE_FQDN_FRONTEND} in Coolify env.
This commit is contained in:
epistemophiliac 2026-06-16 22:01:55 -04:00
parent 1ba0f85d0f
commit cfee4fcfa3

View file

@ -102,13 +102,14 @@ services:
entrypoint: ['bash', '-c'] entrypoint: ['bash', '-c']
command: command:
- > - >
export CI=1;
B=/usr/local/bin/bench; B=/usr/local/bin/bench;
SITE=$$SITE_NAME; SITE=$$SITE_NAME;
if [ -z "$$SITE" ]; then echo "[create-site] ERROR: SITE_NAME empty — assign domain to frontend:8080 in Coolify (SERVICE_FQDN_FRONTEND)"; exit 1; fi; if [ -z "$$SITE" ]; then echo "[create-site] ERROR: SITE_NAME empty — assign domain to frontend:8080 in Coolify (SERVICE_FQDN_FRONTEND)"; exit 1; fi;
wait-for-it -t 120 db:3306; wait-for-it -t 120 db:3306;
wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-cache:6379;
wait-for-it -t 120 redis-queue:6379; wait-for-it -t 120 redis-queue:6379;
if [ -d "sites/$$SITE" ]; then echo "[create-site] exists"; $$B use "$$SITE"; else echo "[create-site] creating (10-20 min first time — progress bars suppressed in deploy log)"; INSTALL_ARGS=""; IFS=',' read -r -a apps <<< "$$INSTALL_APPS"; for app in "$${apps[@]}"; do INSTALL_ARGS="$$INSTALL_ARGS --install-app $$app"; done; set -o pipefail; $$B new-site "$$SITE" --mariadb-user-host-login-scope='%' --admin-password "$$ADMIN_PASSWORD" --db-root-password "$$DB_PASSWORD" $$INSTALL_ARGS --set-default 2>&1 | grep -vE '^Updating DocTypes for '; fi if [ -d "sites/$$SITE" ]; then echo "[create-site] exists"; $$B use "$$SITE"; else echo "[create-site] creating (10-20 min first time — verbose progress suppressed)"; INSTALL_ARGS=""; IFS=',' read -r -a apps <<< "$$INSTALL_APPS"; for app in "$${apps[@]}"; do INSTALL_ARGS="$$INSTALL_ARGS --install-app $$app"; done; set -o pipefail; $$B new-site "$$SITE" --mariadb-user-host-login-scope='%' --admin-password "$$ADMIN_PASSWORD" --db-root-password "$$DB_PASSWORD" $$INSTALL_ARGS --set-default 2>&1 | grep -vE '^Updating DocTypes for |^Creating Workspace|^Creating Desktop Icons|^Updating Dashboard for |^\* Installing |^Patching Existing|^rename_field:|^Thank you for installing|^Setting up Frappe HR'; fi
environment: environment:
- 'SITE_NAME=${SITE_NAME:-${SERVICE_FQDN_FRONTEND}}' - 'SITE_NAME=${SITE_NAME:-${SERVICE_FQDN_FRONTEND}}'
- 'ADMIN_PASSWORD=${ADMIN_PASSWORD:-changeme}' - 'ADMIN_PASSWORD=${ADMIN_PASSWORD:-changeme}'
@ -133,7 +134,7 @@ services:
if [ -z "$$(find sites -mindepth 2 -maxdepth 2 -name site_config.json 2>/dev/null)" ]; then echo "[migrator] no sites"; exit 0; fi; if [ -z "$$(find sites -mindepth 2 -maxdepth 2 -name site_config.json 2>/dev/null)" ]; then echo "[migrator] no sites"; exit 0; fi;
echo "[migrator] migrating all sites"; echo "[migrator] migrating all sites";
set -o pipefail; set -o pipefail;
bench --site all migrate 2>&1 | grep -vE '^Updating DocTypes for '; bench --site all migrate 2>&1 | grep -vE '^Updating DocTypes for |^Creating Workspace|^Creating Desktop Icons|^Updating Dashboard for ';
environment: environment:
- 'MIGRATE_SITES=${MIGRATE_SITES:-true}' - 'MIGRATE_SITES=${MIGRATE_SITES:-true}'
depends_on: depends_on: