Spaces:
Runtime error
Runtime error
Create entrypoint.sh
Browse files123456789101112131415161718192021222324252627282930#!/bin/shset -eCONFIG_FILE_PATH="/home/api.yaml" # 注意这里改成/home/api.yaml
echo "DEBUG: Entrypoint script started."
# 检查Secret是否存在if [ -z "$API_YAML_CONTENT" ]; then echo "ERROR: Secret 'API_YAML_CONTENT' is不存在或为空。退出。" exit 1else echo "DEBUG: API_YAML_CONTENT secret found. Preparing to write..." printf '%s\n' "$API_YAML_CONTENT" > "$CONFIG_FILE_PATH" echo "DEBUG: Attempted to write to $CONFIG_FILE_PATH."
if [ -f "$CONFIG_FILE_PATH" ]; then echo "DEBUG: File $CONFIG_FILE_PATH created successfully. Size: $(wc -c < "$CONFIG_FILE_PATH") bytes." # 显示文件的前几行进行调试(注意不要显示敏感信息) echo "DEBUG: First few lines (without sensitive info):" head -n 3 "$CONFIG_FILE_PATH" | grep -v "api:" | grep -v "password" else echo "ERROR: File $CONFIG_FILE_PATH was NOT created." exit 1 fifi
echo "DEBUG: About to execute python main.py..."# 不需要使用--config参数,因为程序有默认路径cd /homeexec python main.py "$@"entrypoint.shAdded+30