22 lines
931 B
Bash
Executable File
22 lines
931 B
Bash
Executable File
#!/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 |