From 7c21378296fa84e7228cd8f5be7a5d503b9dbb09 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 26 Aug 2026 23:48:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(build):=20getConfig=20=E6=98=BE=E5=BC=8F?= =?UTF-8?q?=E4=BC=A0=E5=AE=BF=E4=B8=BB=E6=A0=B9=E7=9B=AE=E5=BD=95=EF=BC=88?= =?UTF-8?q?=E5=90=A6=E5=88=99=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=88=B0=E6=A8=A1=E5=9D=97=E8=87=AA=E8=BA=AB=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=89=BE=E4=B8=8D=E5=88=B0=20conf=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 0741b21..61fb91d 100644 --- a/build.sh +++ b/build.sh @@ -25,7 +25,7 @@ echo "Host app root: $APP_ROOT" # ── 1. 建表(幂等:CREATE TABLE IF NOT EXISTS 由 json2ddl 产物改造)── cd "$SCRIPT_DIR" -"$PYTHON" - <<'PYEOF' +"$PYTHON" - "$APP_ROOT" <<'PYEOF' import re, sys, os ddl = open('mysql.ddl.sql', encoding='utf-8').read() # json2ddl 产物含 drop table if exists,部署期改为 IF NOT EXISTS 幂等建表 @@ -35,12 +35,12 @@ open('/tmp/pipeline_bidding_ddl.sql', 'w', encoding='utf-8').write(ddl) print('DDL prepared:', ddl.count('CREATE TABLE IF NOT EXISTS'), 'tables') PYEOF -"$PYTHON" - <<'PYEOF' +"$PYTHON" - "$APP_ROOT" <<'PYEOF' import sys, os, subprocess sys.path.insert(0, os.getcwd()) from appPublic.jsonConfig import getConfig from appPublic.aes import aes_decode_b64 -cfg = getConfig('.', {'workdir': '.'}) +cfg = getConfig(sys.argv[1], {'workdir': sys.argv[1]}) kw = cfg.databases['pipeline'].kwargs pwd = aes_decode_b64(cfg.password_key, kw.password) with open('/tmp/pipeline_bidding_ddl.sql', 'rb') as f: @@ -56,7 +56,7 @@ PYEOF # ── 2. 种子数据:appcodes 字典 + pipelines 产线记录(数据源 init/data.json,幂等)── cd "$APP_ROOT" -"$PYTHON" - "$SCRIPT_DIR" <<'PYEOF' +"$PYTHON" - "$SCRIPT_DIR" "$APP_ROOT" <<'PYEOF' import sys, os, json, asyncio CDIR = sys.argv[1] sys.path.insert(0, os.getcwd()) @@ -67,7 +67,7 @@ from appPublic.uniqueID import getID data = json.load(open(os.path.join(CDIR, 'init', 'data.json'))) async def seed(): - config = getConfig('.') + config = getConfig(sys.argv[2], {'workdir': sys.argv[2]}) db = DBPools(config.databases) async with db.sqlorContext('pipeline') as sor: # pipelines 产线主记录(checklist 第 0 步)