背景
原有springboot项目包含多个模块,随着团队越来越大,大家每次修改合并到master时,总会牵扯到别的项目代码,偶尔度越来越高
项目拆分方案
评价服务(第一阶段)
1.git subtree
2.申请新评价系统服务(申请2台机器,评价总计6台)
- 老评价服务有master分支提交,发送邮件通知(由于分为两阶段做,缩短了时间,所以这步可不做)
3.灰度发布
4.正式发布,验证新服务
5.如果4有问题,pass平台摘除或eureka下线
6.验证成功后,通知迁移完成
7.下线老评价服务
评价服务(第二阶段)
1.梳理现有其他服务调用评价服务dao
2.开发API
- B端对接
3.B端没法及时对接,提测接口测试;B端能正常对接,联调测试,整体提测
4.上线
额外:
数据库拆分
subtree
选择subtree去做,而不是传统的复制粘贴,是因为subtree会保留原项目里的提交记录
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used/mall-base-api (master)
$ git subtree split -P base-api-evaluat -b initBranch
Created branch 'initBranch'
b826d57ccee0025e30de11a01c5ad9c2756821dd
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used/mall-base-api (master)
$ cd ../
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used (master)
$ mkdir mall-evaluate
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used (master)
$ cd mall-evaluate/
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used/mall-evaluate (master)
$ git init
Initialized empty Git repository in D:/Ideal/Ideal_Used/mall-evaluate/.git/
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used/mall-evaluate (master)
$ git pull ../mall-base-api initBranch
remote: Enumerating objects: 590, done.
remote: Counting objects: 100% (590/590), done.
remote: Compressing objects: 100% (342/342), done.
remote: Total 590 (delta 240), reused 280 (delta 105)
Receiving objects: 100% (590/590), 81.29 KiB | 1.85 MiB/s, done.
Resolving deltas: 100% (240/240), done.
From ../mall-base-api
* branch initBranch -> FETCH_HEAD
Administrator@20191128-144922 MINGW64 /d/Ideal/Ideal_Used/mall-evaluate (master)
$ git remote add origin git@gitlab.xxx.corp:xxx/mall-evaluate.git