验证在线 LUT 分类、帧上传与下载应用,准备 1.22.0
这个提交包含在:
1 父节点
a2a8624dc0
当前提交
a04c4a69ed
11 个文件已更改
+295
-27
没有与搜索条件相匹配的文件
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Deploy only the two reviewed online-LUT files from the scoped local workspace."""
|
||||
import json, os, shutil, subprocess
|
||||
from pathlib import Path
|
||||
from deploy import ROOT, LOCAL, NAS, STAMP, check_mount, deploy_file, sha, write_json
|
||||
|
||||
FILES=[Path('wp-content/mu-plugins/dayu-color-online-luts/renderer.php'),Path('wp-content/mu-plugins/dayu-color-online-luts.php')]
|
||||
|
||||
def main():
|
||||
mount=check_mount()
|
||||
contract=subprocess.run(['php',str(ROOT/'Backend/tests/online_luts.php')],capture_output=True,text=True,check=True)
|
||||
assert json.loads(contract.stdout)['pass']
|
||||
report=ROOT/'verification/OnlineLUTDeployment.json'
|
||||
previous=json.loads(report.read_text()) if report.exists() else {}
|
||||
old={entry['relativePath']:entry for entry in previous.get('files',[])}
|
||||
LOCAL.mkdir(parents=True,exist_ok=True);lock=LOCAL/'.deployment.lock';lock.mkdir()
|
||||
write_json(lock/'owner.json',dict(pid=os.getpid(),cwd=str(ROOT),started=STAMP))
|
||||
results=[]
|
||||
try:
|
||||
for relative in FILES:
|
||||
source=ROOT/'Backend'/relative;local=LOCAL/relative;target=NAS/relative
|
||||
subprocess.run(['php','-l',str(source)],check=True,capture_output=True)
|
||||
# Deploy only a remotely saved source checkpoint.
|
||||
tracked=subprocess.check_output(['git','show','HEAD:Backend/'+str(relative)],cwd=ROOT)
|
||||
assert tracked==source.read_bytes(),'Backend source is not committed'
|
||||
expected=old.get(str(relative),{}).get('sha256')
|
||||
if local.exists() and local.read_bytes()!=source.read_bytes():assert sha(local)==expected,'Local undeployed changes exist'
|
||||
local.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(source,local)
|
||||
result=deploy_file(local,target,allow_new=not expected,expected=expected)
|
||||
result['relativePath']=str(relative);result['readable']=os.access(target,os.R_OK);result['mode']=oct(target.stat().st_mode&0o777);results.append(result)
|
||||
write_json(report,dict(timestamp=STAMP,mount=mount,localProject=str(LOCAL),nasRoot=str(NAS),sourceCommit=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip(),files=results))
|
||||
print(json.dumps(dict(deployed=len(results),report=str(report)),ensure_ascii=False))
|
||||
finally:
|
||||
shutil.rmtree(lock)
|
||||
if __name__=='__main__':main()
|
||||
在新工单中引用
屏蔽一个用户