静态站点改用就绪后切换的滚动发布,避免停机等待
verify / verify (push) Canceled after 0s

This commit is contained in:
fam
2026-09-21 12:16:31 +01:00
parent acfa02f96d
commit 41114eb0ad
+1 -1
View File
@@ -30,7 +30,7 @@ def main():
ssh('mkdir','-p',target) ssh('mkdir','-p',target)
run('rsync','-az','--chmod=D755,F644',str(ROOT/'public')+'/',f'{HOST}:{target}/') run('rsync','-az','--chmod=D755,F644',str(ROOT/'public')+'/',f'{HOST}:{target}/')
def point(path): def point(path):
patch={'spec':{'template':{'spec':{'volumes':[{'name':'site','hostPath':{'path':path,'type':'Directory'}}]}}}} patch={'spec':{'strategy':{'type':'RollingUpdate','rollingUpdate':{'maxUnavailable':0,'maxSurge':1}},'template':{'spec':{'volumes':[{'name':'site','hostPath':{'path':path,'type':'Directory'}}]}}}}
kube('patch','deployment','hugo','--type=strategic','-p',json.dumps(patch)) kube('patch','deployment','hugo','--type=strategic','-p',json.dumps(patch))
kube('rollout','status','deployment/hugo','--timeout=120s') kube('rollout','status','deployment/hugo','--timeout=120s')
try: try: