debug
This commit is contained in:
@@ -52,7 +52,37 @@ cd "${DOMAINCHECK_DIR}"
|
||||
python3.11 -m venv .venv || true
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
python3.11 - <<'PY'
|
||||
from pathlib import Path
|
||||
|
||||
source = Path("requirements.txt")
|
||||
target = Path("requirements.linux.txt")
|
||||
raw = source.read_bytes()
|
||||
for encoding in ("utf-8", "utf-16", "utf-16-le", "utf-16-be", "gbk"):
|
||||
try:
|
||||
text = raw.decode(encoding)
|
||||
break
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
else:
|
||||
raise SystemExit("无法解析 requirements.txt 编码")
|
||||
|
||||
skip_prefixes = (
|
||||
"pywin32==",
|
||||
"pywin32-ctypes==",
|
||||
"twisted-iocpsupport==",
|
||||
"win32-setctime==",
|
||||
)
|
||||
lines = []
|
||||
for line in text.splitlines():
|
||||
normalized = line.strip().lstrip("\ufeff")
|
||||
if normalized.lower().startswith(skip_prefixes):
|
||||
continue
|
||||
lines.append(normalized)
|
||||
|
||||
target.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
PY
|
||||
pip install -r requirements.linux.txt
|
||||
"${DOMAINCHECK_DIR}/.venv/bin/pip" install fastapi uvicorn pydantic-settings psycopg2-binary redis openpyxl python-multipart
|
||||
|
||||
cat >"${DOMAINCHECK_DIR}/.env" <<EOF
|
||||
@@ -103,6 +133,7 @@ systemctl enable domaincheck-worker
|
||||
systemctl enable domaincheck-sync-agent
|
||||
systemctl restart domaincheck-worker
|
||||
systemctl restart domaincheck-sync-agent
|
||||
chown -R www:www "${REPO_DIR}"
|
||||
|
||||
echo
|
||||
echo "国内 controller 部署完成,建议继续执行:"
|
||||
|
||||
@@ -53,7 +53,37 @@ cd "${DOMAINCHECK_DIR}"
|
||||
python3.11 -m venv .venv || true
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
python3.11 - <<'PY'
|
||||
from pathlib import Path
|
||||
|
||||
source = Path("requirements.txt")
|
||||
target = Path("requirements.linux.txt")
|
||||
raw = source.read_bytes()
|
||||
for encoding in ("utf-8", "utf-16", "utf-16-le", "utf-16-be", "gbk"):
|
||||
try:
|
||||
text = raw.decode(encoding)
|
||||
break
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
else:
|
||||
raise SystemExit("无法解析 requirements.txt 编码")
|
||||
|
||||
skip_prefixes = (
|
||||
"pywin32==",
|
||||
"pywin32-ctypes==",
|
||||
"twisted-iocpsupport==",
|
||||
"win32-setctime==",
|
||||
)
|
||||
lines = []
|
||||
for line in text.splitlines():
|
||||
normalized = line.strip().lstrip("\ufeff")
|
||||
if normalized.lower().startswith(skip_prefixes):
|
||||
continue
|
||||
lines.append(normalized)
|
||||
|
||||
target.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
PY
|
||||
pip install -r requirements.linux.txt
|
||||
"${DOMAINCHECK_DIR}/.venv/bin/pip" install fastapi uvicorn pydantic-settings psycopg2-binary redis openpyxl python-multipart
|
||||
|
||||
cat >"${DOMAINCHECK_DIR}/.env" <<EOF
|
||||
@@ -102,6 +132,7 @@ EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable domaincheck-worker
|
||||
systemctl restart domaincheck-worker
|
||||
chown -R www:www "${REPO_DIR}"
|
||||
|
||||
echo
|
||||
echo "国内 worker 部署完成,建议继续在国外机查看:"
|
||||
|
||||
@@ -59,7 +59,37 @@ cd "${DOMAINCHECK_DIR}"
|
||||
python3.11 -m venv .venv || true
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
python3.11 - <<'PY'
|
||||
from pathlib import Path
|
||||
|
||||
source = Path("requirements.txt")
|
||||
target = Path("requirements.linux.txt")
|
||||
raw = source.read_bytes()
|
||||
for encoding in ("utf-8", "utf-16", "utf-16-le", "utf-16-be", "gbk"):
|
||||
try:
|
||||
text = raw.decode(encoding)
|
||||
break
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
else:
|
||||
raise SystemExit("无法解析 requirements.txt 编码")
|
||||
|
||||
skip_prefixes = (
|
||||
"pywin32==",
|
||||
"pywin32-ctypes==",
|
||||
"twisted-iocpsupport==",
|
||||
"win32-setctime==",
|
||||
)
|
||||
lines = []
|
||||
for line in text.splitlines():
|
||||
normalized = line.strip().lstrip("\ufeff")
|
||||
if normalized.lower().startswith(skip_prefixes):
|
||||
continue
|
||||
lines.append(normalized)
|
||||
|
||||
target.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
PY
|
||||
pip install -r requirements.linux.txt
|
||||
"${DOMAINCHECK_DIR}/.venv/bin/pip" install fastapi uvicorn pydantic-settings psycopg2-binary redis openpyxl python-multipart
|
||||
|
||||
cat >"${DOMAINCHECK_DIR}/.env" <<EOF
|
||||
@@ -117,6 +147,7 @@ systemctl enable domaincheck-api
|
||||
systemctl enable domaincheck-worker
|
||||
systemctl restart domaincheck-api
|
||||
systemctl restart domaincheck-worker
|
||||
chown -R www:www "${REPO_DIR}"
|
||||
|
||||
echo
|
||||
echo "国外主控机部署完成,建议继续执行:"
|
||||
|
||||
Reference in New Issue
Block a user