Spaces:
Runtime error
Runtime error
Update hf-entrypoint.sh
Browse files123 unmodified lines12412512612712812913013113213322 unmodified lines1561571581591601611621631641652 unmodified lines1681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002014 unmodified lines206207208209210211212123 unmodified lines"db_socket": "/tmp/mysql.sock"}EOFbench use ${SITE_NAME}# ============================================================# 7. DATABASE: INIT OR MIGRATE# ============================================================echo ">>> Checking database state..."DB_INITIALIZED=false22 unmodified lines"db_type": "mariadb","db_host": "localhost","db_port": 3306,"db_socket": "/tmp/mysql.sock","redis_cache": "redis://localhost:6379","redis_queue": "redis://localhost:6379","redis_socketio": "redis://localhost:6379"}EOFelse2 unmodified linesfi# ============================================================# 8. CUSTOM APPS# ============================================================if [ -n "${CUSTOM_APPS}" ]; thenecho ">>> Installing custom apps..."for REPO_URL in $(echo "${CUSTOM_APPS}" | tr ',' ' '); do[ -z "${REPO_URL}" ] && continue# Convert the repo name to lowercase so Frappe recognizes the python moduleAPP_NAME=$(basename -s .git "${REPO_URL}" | tr '[:upper:]' '[:lower:]')if [ ! -d "apps/${APP_NAME}" ]; thenecho " β Fetching ${APP_NAME}..."bench get-app --resolve-deps "${REPO_URL}"elseecho " β ${APP_NAME} already fetched, skipping."fiif ! bench --site "${SITE_NAME}" list-apps 2>/dev/null | grep -qx "${APP_NAME}"; thenecho " β Installing ${APP_NAME} on site..."bench --site "${SITE_NAME}" install-app "${APP_NAME}" || trueelseecho " β ${APP_NAME} already installed, skipping."fidonefi# ============================================================# 9. BUILD ASSETS# ============================================================# Assets must be built in the ephemeral container storage so relative symlinks workif [ ! -d "sites/assets/frappe" ]; then4 unmodified linesfi# ============================================================# 10. WRITE PROCFILE AND START# ============================================================echo ">>> Writing Procfile..."cat > Procfile <<EOF123 unmodified lines12412512612712812913013113213313413513613713813914014114214314414514614714814915015115222 unmodified lines1751761771781791801812 unmodified lines1841851861871881891901911921931941951961971981992002012022032042052062072084 unmodified lines213214215216217218219123 unmodified lines"db_socket": "/tmp/mysql.sock"}EOFbench use ${SITE_NAME}# ============================================================# 7. FETCH CUSTOM APPS (Must happen before migration)# ============================================================if [ -n "${CUSTOM_APPS}" ]; thenecho ">>> Fetching custom app code..."for REPO_URL in $(echo "${CUSTOM_APPS}" | tr ',' ' '); do[ -z "${REPO_URL}" ] && continueAPP_NAME=$(basename -s .git "${REPO_URL}" | tr '[:upper:]' '[:lower:]')if [ ! -d "apps/${APP_NAME}" ]; thenecho " β Fetching ${APP_NAME}..."bench get-app --resolve-deps "${REPO_URL}"elseecho " β ${APP_NAME} code already exists."fidonefi# ============================================================# 8. DATABASE: INIT OR MIGRATE# ============================================================echo ">>> Checking database state..."DB_INITIALIZED=false22 unmodified lines"db_type": "mariadb","db_host": "localhost","db_port": 3306,"db_socket": "/tmp/mysql.sock"}EOFelse2 unmodified linesfi# ============================================================# 9. INSTALL CUSTOM APPS ON SITE# ============================================================if [ -n "${CUSTOM_APPS}" ]; thenecho ">>> Checking site app installations..."for REPO_URL in $(echo "${CUSTOM_APPS}" | tr ',' ' '); do[ -z "${REPO_URL}" ] && continueAPP_NAME=$(basename -s .git "${REPO_URL}" | tr '[:upper:]' '[:lower:]')if ! bench --site "${SITE_NAME}" list-apps 2>/dev/null | grep -qx "${APP_NAME}"; thenecho " β Installing ${APP_NAME} on site..."bench --site "${SITE_NAME}" install-app "${APP_NAME}" || trueelseecho " β ${APP_NAME} is already installed on the site, skipping."fidonefi# ============================================================# 10. BUILD ASSETS# ============================================================# Assets must be built in the ephemeral container storage so relative symlinks workif [ ! -d "sites/assets/frappe" ]; then4 unmodified linesfi# ============================================================# 11. WRITE PROCFILE AND START# ============================================================echo ">>> Writing Procfile..."cat > Procfile <<EOF
hf-entrypoint.sh+26-19