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