Files
nexus/wiki/concepts/Shift-and-Lift.md
2026-04-29 04:03:31 +08:00

64 lines
2.1 KiB
Markdown
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.
---
title: "Shift and Lift"
type: concept
tags: [Shift-and-Lift, Migration, CI/CD, GitLab, GitHub, Refactoring]
sources:
- public-cloud-learning-sessions-opentext-github-enterprise-to-gitlab-migration-20
last_updated: 2026-05-09
---
## Shift and Lift
Shift and Lift搬移重构是 GitHub Enterprise → GitLab 迁移中的两种主要策略之一:将代码直接复制到 GitLab同时对 CI/CD 流水线进行转换和重构。
## Definition
Shift and Lift = 代码搬移Shift+ 流水线重构Lift
- 将源代码一次性复制到 GitLab
- 同时将 GitHub Actions/Jenkins 等流水线转换为 GitLab CI/CD
- 源 GitHub 仓库在验证后废弃
## 适用场景
- 各团队已明确了解自身 GitHub 使用情况
- 流水线可预测,重构工作量可控
- 有足够技术能力进行 GitLab CI/CD 重构的团队
## 迁移步骤OpenText 建议)
1. **盘点资产**:识别 GitHub 中所有仓库和流水线
2. **规划流水线**:对照 GitLab CI/CD 语法设计目标流水线
3. **代码迁移**:将代码复制到 GitLab 仓库
4. **流水线实施**:配置 GitLab CI/CD pipelines
5. **验证**:测试代码和流水线在 GitLab 的运行
6. **废弃 GitHub**:确认无误后废弃源仓库
7. **更新 PHT**:在 [[PHTProduct Hub Platform]] 中更新映射状态
## 迁移完成标准
OpenText 定义的"Definition of Done"
1. ✅ 代码迁移完成
2. ✅ 流水线转型完成
3. ✅ [[PHTProduct Hub Platform]] 更新完成
## 核心挑战
- **流水线复杂性**GitHub Actions / Jenkins → GitLab CI 的语法差异
- **凭证管理**GitHub Secrets → GitLab CI Variables 的迁移
- **网络连通性**GitLab 代理配置Brook Park GitLab Proxy
## 与 Repo Mirroring 的对比
| 维度 | Shift and Lift | Mirroring |
|------|----------------|-----------|
| 源仓库 | 废弃 | 保持不变 |
| 流水线 | 需重构 | 保持原样 |
| 风险 | 中高 | 低 |
| 适合团队 | 有规划能力 | 需要过渡期 |
详见 [[Repo-Mirroring]] 迁移方案
## Sources
- [[public-cloud-learning-sessions-opentext-github-enterprise-to-gitlab-migration-20]]