与 __alone/Jenkinsfile-prod-promote-from-uat.groovy(拷 jar + compose restart)对应,本流水线只做:
docker pull 39.105.153.68/alien_cloud/<服务>:<SOURCE_TAG>
docker tag → :<TARGET_TAG>
docker push
kubectl set image(可选)
不 Checkout 业务代码、不 Maven、不 docker build。
| 项 | 值 |
|---|---|
| 建议 Job 名 | alien-cloud-k8s-promote-image |
| 类型 | 流水线 |
| 定义 | Pipeline script from SCM |
| 仓库 | http://8.152.195.41:3000/alien/alien_cloud |
| 分支 | 预生产分支,如 */uat-20260202 |
| Script Path | docs/jenkins/produ/promote-image/Jenkinsfile |
| SCM Credentials | Git 凭据(如 zhanghaomimapingzheng 或 dujian/****** (git)) |
| 下拉框 | 应选什么 | 用途 |
|---|---|---|
| Repository URL 旁的 Credentials | Git 账号(拉 Jenkinsfile) | 不要选 robot$alien_cloud+jenkins-k8s |
| 流水线内 Harbor 登录 | 凭据 ID harbor-robot-alien |
用户名 robot$alien_cloud+jenkins-k8s,密码为 Token |
Harbor 机器人在 Jenkins 凭据管理里单独建 Username with password,ID 必须为 harbor-robot-alien(与 Jenkinsfile environment 一致)。
| 参数 | 说明 |
|---|---|
DEPLOY_MODE |
whole / single / multi |
SOURCE_TAG |
预生产镜像 tag,推荐 uat-latest;历史快照 uat-build-<N> |
TARGET_TAG |
生产 tag,默认 produ-${BUILD_NUMBER} |
HARBOR_REGISTRY |
39.105.153.68 |
HARBOR_PROJECT |
alien_cloud |
DEPLOY_STRATEGY |
rolling / canary / skip(只推镜像、不改 ACK) |
DRY_RUN |
只打印计划 |
现网 88 上 UAT 若只打 jar 到 /alien_uat/java、未推 Harbor,需先有一次:
push 到 39.105.153.68/alien_cloud/<服务>:uat-latest(旧 latest 归档为 uat-build-<号>),或之后本 Job 只做 tag 晋升,不再拉 Git 代码。
单服务 Job(如 Gateway-K8s)与 promote-image 均为仅晋升镜像;界面配置见 README-JOB-GATEWAY.md。
生产发版推荐:UAT 推 uat-latest → Gateway-K8s / promote-image(SOURCE_TAG=uat-latest)→ ACK。