Files
2026-10-29 20:50:33 +07:00

22 lines
931 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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
# 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' \
web_hgtv_h5 templates/ static/
scp web_hgtv_h5.tar.gz root@172.104.166.87:/data/uzip
ssh root@172.104.166.87 "/server/web_hgtv/h5/up_app.sh"
rm -rf ./web_hgtv_h5 ./web_hgtv_h5.tar.gz