diff --git a/.drone.yml b/.drone.yml index 50628b2..e89c582 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,18 +8,18 @@ platform: services: - name: postgres - image: postgres:17.12 + image: postgres:15-alpine environment: POSTGRES_HOST_AUTH_METHOD: trust steps: - name: verify - image: maven:3.9.11-eclipse-temurin-21-alpine + image: python:3.13-alpine environment: ATLAS_LOCAL_PASSWORD: atlas-ci-example ATLAS_DELIVERY_PASSWORD: atlas-ci-delivery-example commands: - - apk add --no-cache python3 postgresql17-client + - apk add --no-cache openjdk21-jdk maven postgresql-client - mvn -B -ntp -f backend/pom.xml verify - sh deploy/local/ci-smoke.sh - name: publish-gateway diff --git a/deploy/local/ci-smoke.sh b/deploy/local/ci-smoke.sh index 87c98f7..66d6cad 100755 --- a/deploy/local/ci-smoke.sh +++ b/deploy/local/ci-smoke.sh @@ -15,7 +15,7 @@ CREATE DATABASE itematlas_inventory OWNER atlas_inventory; CREATE DATABASE itematlas_intake OWNER atlas_intake; SQL -export SPRING_PROFILES_ACTIVE=local ATLAS_DB_PASSWORD="" +export SPRING_PROFILES_ACTIVE=local ATLAS_DB_PASSWORD="" JAVA_TOOL_OPTIONS="-Xmx192m" ATLAS_DB_USER=atlas_inventory ATLAS_DB_URL=jdbc:postgresql://postgres:5432/itematlas_inventory \ java -jar backend/inventory-service/target/app.jar > /tmp/atlas-inventory.log 2>&1 & service_pids="$!" diff --git a/docs/deployment/backend-release.md b/docs/deployment/backend-release.md index 29fd61c..c4ba2c9 100644 --- a/docs/deployment/backend-release.md +++ b/docs/deployment/backend-release.md @@ -2,7 +2,7 @@ ## 从提交到部署 -1. Gitea 保存代码。Drone `backend-ci` 在常规提交和发布标签上运行 Maven 和 API 冒烟,PostgreSQL 作为流水线服务。发布标签采用 `v*`。标签验证通过后构建并推送三个 ARM64 镜像,镜像标签使用完整提交 SHA。 +1. Gitea 保存代码。Drone `backend-ci` 在常规提交和发布标签上运行 Java 21、Maven 和 API 冒烟。CI 使用 runner 已缓存的 PostgreSQL 15 镜像做兼容验证,本地和目标部署使用 PostgreSQL 17。发布标签采用 `v*`。标签验证通过后构建并推送三个 ARM64 镜像,镜像标签使用完整提交 SHA。 2. 在 Drone 提升同一个成功构建到 `staging`。部署步骤使用 Helm 3 的 `upgrade --install --atomic --wait`。就绪探针检查应用和数据库,Helm hook 逐个访问 Kubernetes Service。 3. 在预发布验证业务请求,再将同一个构建提升到 `production`。正式端口由既有入口配置转发到网关。数据库、Ollama 与 Actuator 保持内部访问。