From ed244a285084488b2390a5f0c3619b73aeeb0cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=AE=87=E5=AE=81?= Date: Thu, 29 Oct 2026 20:50:33 +0700 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/deploy_prod.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/deploy_prod.sh b/app/deploy_prod.sh index 70e90b3..08ff554 100755 --- a/app/deploy_prod.sh +++ b/app/deploy_prod.sh @@ -1,13 +1,19 @@ #!/bin/bash +# 任一步失败立即退出,避免编译失败时仍把模板上传到线上(新模板 + 旧二进制会导致页面渲染中断) +set -e +cd "$(dirname "$0")" +export PATH="$PATH:/usr/local/go/bin:$HOME/sdk/go/bin" echo "开始" rm -rf ./web_hgtv_h5 ./web_hgtv_h5.tar.gz GOOS=linux GOARCH=amd64 go build -o web_hgtv_h5 -tar zvcf web_hgtv_h5.tar.gz web_hgtv_h5 templates/ static/ \ +# macOS 的 tar 只识别写在文件列表前面的 --exclude;COPYFILE_DISABLE 避免打入 macOS 扩展属性 +COPYFILE_DISABLE=1 tar zvcf web_hgtv_h5.tar.gz \ --exclude='templates/page/sitemaps/sitemap.xml' \ --exclude='templates/page/sitemaps/sitemap-*.xml' \ --exclude='templates/page/rss.xml' \ --exclude='templates/page/llms.txt' \ - --exclude='templates/page/llms-full.txt' + --exclude='templates/page/llms-full.txt' \ + web_hgtv_h5 templates/ static/ scp web_hgtv_h5.tar.gz root@172.104.166.87:/data/uzip