Spaces:
Runtime error
Runtime error
Update hf-entrypoint.sh
Browse files1 unmodified line234567864 unmodified lines7374757677787980818233 unmodified lines11611711811912012112212352 unmodified lines17617717817918018118218318418518618718818919014 unmodified lines2052062072082092102111 unmodified lineset -eBENCH_DIR=/home/frappe/frappe-benchSITE_NAME=${SITE_NAME:?SITE_NAME is required}# ============================================================# 1. WAIT FOR /data BUCKET MOUNT64 unmodified linesif [ ! -f /data/.db_bootstrapped ]; thenecho ">>> Bootstrapping MariaDB database and user..."mysql --socket=/tmp/mysql.sock -u root <<EOFALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD:?DB_ROOT_PASSWORD env var is required}';CREATE DATABASE IF NOT EXISTS \`${DB_NAME:?DB_NAME env var is required}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER IF NOT EXISTS '${DB_NAME:?DB_NAME env var is required}'@'localhost' IDENTIFIED BY '${DB_PASSWORD:?DB_PASSWORD env var is required}';GRANT ALL PRIVILEGES ON \`${DB_NAME:?DB_NAME env var is required}\`.* TO '${DB_NAME:?DB_NAME env var is required}'@'localhost';FLUSH PRIVILEGES;EOFtouch /data/.db_bootstrapped33 unmodified linesmkdir -p sites/${SITE_NAME}cat > sites/${SITE_NAME}/site_config.json <<EOF{"DB_NAME:?DB_NAME env var is required": "${DB_NAME:?DB_NAME env var is required}","DB_PASSWORD:?DB_PASSWORD env var is required": "${DB_PASSWORD:?DB_PASSWORD env var is required}","db_type": "mariadb","db_host": "localhost","db_port": 3306,52 unmodified lines--db-host "localhost" \--db-type mariadb \--db-root-username root \--db-root-password "${DB_ROOT_PASSWORD:?DB_ROOT_PASSWORD env var is required}" \--admin-password "${ADMIN_PASSWORD:-admin}" \--force# Restore config (new-site overwrites it)cat > sites/${SITE_NAME}/site_config.json <<EOF{"DB_NAME:?DB_NAME env var is required": "${DB_NAME:?DB_NAME env var is required}","DB_PASSWORD:?DB_PASSWORD env var is required": "${DB_PASSWORD:?DB_PASSWORD env var is required}","db_type": "mariadb","db_host": "localhost","db_port": 3306,14 unmodified lines[ -z "${REPO_URL}" ] && continueAPP_NAME=$(basename -s .git "${REPO_URL}" | tr '[:upper:]' '[:lower:]')if ! bench --site "${SITE_NAME}" list-apps 2>/dev/null | awk '{print $1}' | grep -qx "${APP_NAME}"; thenecho " → Installing ${APP_NAME} on site..."bench --site "${SITE_NAME}" install-app "${APP_NAME}" || trueelse1 unmodified line234567864 unmodified lines7374757677787980818233 unmodified lines11611711811912012112212352 unmodified lines17617717817918018118218318418518618718818919014 unmodified lines2052062072082092102111 unmodified lineset -eBENCH_DIR=/home/frappe/frappe-benchSITE_NAME=${SITE_NAME}# ============================================================# 1. WAIT FOR /data BUCKET MOUNT64 unmodified linesif [ ! -f /data/.db_bootstrapped ]; thenecho ">>> Bootstrapping MariaDB database and user..."mysql --socket=/tmp/mysql.sock -u root <<EOFALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD}';CREATE DATABASE IF NOT EXISTS \`${DB_NAME}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER IF NOT EXISTS '${DB_NAME}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}';GRANT ALL PRIVILEGES ON \`${DB_NAME}\`.* TO '${DB_NAME}'@'localhost';FLUSH PRIVILEGES;EOFtouch /data/.db_bootstrapped33 unmodified linesmkdir -p sites/${SITE_NAME}cat > sites/${SITE_NAME}/site_config.json <<EOF{"db_name": "${DB_NAME}","db_password": "${DB_PASSWORD}","db_type": "mariadb","db_host": "localhost","db_port": 3306,52 unmodified lines--db-host "localhost" \--db-type mariadb \--db-root-username root \--db-root-password "${DB_ROOT_PASSWORD}" \--admin-password "${ADMIN_PASSWORD:-admin}" \--force# Restore config (new-site overwrites it)cat > sites/${SITE_NAME}/site_config.json <<EOF{"db_name": "${DB_NAME}","db_password": "${DB_PASSWORD}","db_type": "mariadb","db_host": "localhost","db_port": 3306,14 unmodified lines[ -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}" || trueelse
hf-entrypoint.sh+11-11