node-sass 4.x cannot build on arm64/Node 16. Use sass with ::v-deep instead of /deep/, and only replace the server dist after the upload is unpacked and verified. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
11 lines
527 B
Bash
Executable File
11 lines
527 B
Bash
Executable File
# sh 执行打包到正式服上
|
|
set -e
|
|
npm run build
|
|
test -f dist/index.html
|
|
rm -f dist.zip
|
|
zip -q -r dist.zip dist
|
|
scp dist.zip root@172.104.39.32:/tmp/dist.zip
|
|
# 先解压并校验,成功后再替换线上目录,避免失败时清空线上
|
|
ssh root@172.104.39.32 "set -e; rm -rf /tmp/extract && unzip -q /tmp/dist.zip -d /tmp/extract && test -f /tmp/extract/dist/index.html && cd /server/91fans/webadmin/dist/ && rm -rf ./* && mv /tmp/extract/dist/* . && rm -rf /tmp/extract /tmp/dist.zip && echo DEPLOY_OK"
|
|
rm dist.zip
|