Files
gsfdc/deploy/package-images.sh
T
wuzilongandCursor 9c7c80e194 feat: 把估价智能体和部署配置提交到主分支
门户估价对话、会员与智能体账号,以及生产 Docker 部署一直停在工作区,远端主分支还没有这些改动。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-23 09:42:44 +08:00

33 lines
1.1 KiB
Bash
Executable File
Raw 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 -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
TAG="${IMAGE_TAG:-20261123}"
if [[ -f "$ROOT/deploy/IMAGE_TAG" ]]; then
TAG="$(tr -d '[:space:]' < "$ROOT/deploy/IMAGE_TAG")"
fi
OUT="$ROOT/deploy/dist"
STAGE="$OUT/gsfdc-bundle"
rm -rf "$STAGE"
mkdir -p "$STAGE/nginx" "$STAGE/mysql" "$STAGE/certs" "$STAGE/certbot"
cp "$ROOT/deploy/docker-compose.yml" "$ROOT/deploy/.env.example" "$STAGE/"
cp "$ROOT/deploy/IMAGE_TAG" "$STAGE/" 2>/dev/null || echo "$TAG" > "$STAGE/IMAGE_TAG"
cp "$ROOT/deploy/"*.sh "$STAGE/"
cp "$ROOT/deploy/nginx/"*.template "$STAGE/nginx/"
cp "$ROOT/deploy/mysql/my.cnf" "$STAGE/mysql/"
cp "$ROOT/deploy/README.md" "$STAGE/" 2>/dev/null || true
echo "打包镜像(含 MySQL、Redis、MinIO)"
docker save \
"gsfdc-server:${TAG}" \
"gsfdc-portal:${TAG}" \
"gsfdc-web:${TAG}" \
mysql:8.0 \
redis:7.4-alpine \
minio/minio:latest \
| gzip -1 > "$STAGE/images.tar.gz"
tar -C "$OUT" -cf "$OUT/gsfdc-bundle-${TAG}.tar" gsfdc-bundle
ls -lh "$STAGE/images.tar.gz" "$OUT/gsfdc-bundle-${TAG}.tar"
echo "离线包 $OUT/gsfdc-bundle-${TAG}.tar"