docs: 修正生产部署运行时命令 #13
@ -112,15 +112,18 @@ test "$(git rev-parse "origin/main^{commit}")" = "$DEPLOY_SHA" || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
git switch main
|
||||
git checkout main
|
||||
git pull --ff-only origin main
|
||||
test "$(git rev-parse HEAD)" = "$DEPLOY_SHA" || {
|
||||
echo '服务器 HEAD 与待部署 SHA 不一致,停止部署'
|
||||
exit 1
|
||||
}
|
||||
|
||||
npm --prefix frontend ci
|
||||
npm --prefix frontend run build
|
||||
docker run --rm \
|
||||
-v /opt/cangku/app/frontend:/workspace \
|
||||
-w /workspace \
|
||||
node:22-bookworm-slim \
|
||||
sh -lc 'npm ci && npm run build'
|
||||
if grep -q '^SOURCE_GIT_SHA=' /opt/cangku/shared/backend.env; then
|
||||
sed -i "s/^SOURCE_GIT_SHA=.*/SOURCE_GIT_SHA=$DEPLOY_SHA/" /opt/cangku/shared/backend.env
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user