big_keeper 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +79 -20
- data/bin/{big-keeper → bigkeeper} +0 -0
- data/docs/en-US/README.md +50 -0
- data/docs/zh-CN/BIGKEEPER_FILE.md +2 -2
- data/docs/zh-CN/FEATURE&HOTFIX.md +121 -0
- data/docs/zh-CN/PODFILE.md +43 -0
- data/docs/zh-CN/README.md +33 -15
- data/docs/zh-CN/RECOMMEND.md +22 -0
- data/docs/zh-CN/RELEASE.md +8 -5
- data/lib/big_keeper/command/feature&hotfix/delete.rb +33 -0
- data/lib/big_keeper/command/feature&hotfix/{feature_finish.rb → finish.rb} +13 -12
- data/lib/big_keeper/command/feature&hotfix/{feature_pull.rb → pull.rb} +4 -4
- data/lib/big_keeper/command/feature&hotfix/{feature_push.rb → push.rb} +4 -8
- data/lib/big_keeper/command/feature&hotfix/{feature_start.rb → start.rb} +7 -7
- data/lib/big_keeper/command/feature&hotfix/{feature_switch.rb → switch.rb} +6 -6
- data/lib/big_keeper/command/feature&hotfix/{feature_update.rb → update.rb} +7 -7
- data/lib/big_keeper/command/release/{release_home.rb → home.rb} +4 -4
- data/lib/big_keeper/command/release/module.rb +106 -0
- data/lib/big_keeper/model/gitflow_type.rb +13 -1
- data/lib/big_keeper/service/git_service.rb +84 -40
- data/lib/big_keeper/service/module_service.rb +52 -62
- data/lib/big_keeper/util/bigkeeper_parser.rb +19 -3
- data/lib/big_keeper/util/git_operator.rb +19 -12
- data/lib/big_keeper/version.rb +1 -1
- data/lib/big_keeper.rb +131 -25
- data/resources/banner.png +0 -0
- data/resources/keynote/big-keeper-readme-example.key +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.001.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.002.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.003.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.004.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.005.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.006.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.007.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.008.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.009.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.010.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.011.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.012.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.013.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.014.jpeg +0 -0
- data/resources/keynote/big-keeper-readme-feature.key +0 -0
- data/resources/keynote/big-keeper-readme-release.key +0 -0
- data/resources/readme/big-keeper-readme.008.png +0 -0
- data/resources/readme/big-keeper-readme.009.png +0 -0
- data/resources/readme/big-keeper-readme.010.png +0 -0
- data/resources/readme/big-keeper-readme.011.png +0 -0
- data/resources/readme/big-keeper-readme.012.png +0 -0
- metadata +40 -17
- data/docs/zh-CN/FEATURE.md +0 -88
- data/lib/big_keeper/command/release/release_module.rb +0 -86
- data/lib/big_keeper/command/release/release_module.sh +0 -44
- data/resources/readme/big-keeper-readme.008.jpeg +0 -0
- data/resources/readme/big-keeper-readme.009.jpeg +0 -0
- data/resources/readme/big-keeper-readme.010.jpeg +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5275d4933523f33d0526dc52a9491079d9bc3b82
|
4
|
+
data.tar.gz: 2dbd46bcd8f579101166731574b21cfda7ae267a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa603c3784108574da97f8a0236a0609dae2fec59ad5bb1131633e1b52dd4c5f71451aaf06d8da269673ea16772ffde7e949b8f90682417f74d94fcfc2f17e1
|
7
|
+
data.tar.gz: 0591f8852f2ba2ebc071c75a3765eac92549b08cb48700fec90466e79e3d91dc3f847e7b370febb596ecb32b86b8ab4d810e4c4b06aec90f548af172ff5171c7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,50 +1,109 @@
|
|
1
|
-
[
|
1
|
+
![](./resources/banner.png)
|
2
|
+
|
3
|
+
[English](./docs/en-US/README.md)
|
2
4
|
|
3
5
|
---
|
4
6
|
|
5
|
-
#
|
7
|
+
# bigkeeper
|
6
8
|
|
7
|
-
[![Build Status](https://travis-ci.org/BigKeeper/
|
9
|
+
[![Build Status](https://travis-ci.org/BigKeeper/bigkeeper.svg?branch=master)](https://travis-ci.org/BigKeeper/bigkeeper)
|
8
10
|
[![Maintainability](https://api.codeclimate.com/v1/badges/c6dc4161e84fcec9a890/maintainability)](https://codeclimate.com/github/BigKeeper/big-keeper/maintainability)
|
9
11
|
[![Gem Version](https://badge.fury.io/rb/big_keeper.svg)](https://rubygems.org/gems/big_keeper)
|
10
12
|
[![Language: Ruby](https://img.shields.io/badge/language-Ruby-da212f.svg)](https://www.ruby-lang.org/)
|
11
13
|
[![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/BigKeeper/big-keeper/blob/master/LICENSE)
|
12
14
|
[![Gitter](https://img.shields.io/gitter/room/BigKeeper/BigKeeper.svg)](https://gitter.im/Big-Keeper/Lobby)
|
13
15
|
|
14
|
-
|
16
|
+
bigkeeper 是一个 **iOS&Android 模块化项目**效率提升工具,使用这个工具后,开发者**在主项目内**即可完成**包括其他业务模块在内**所有代码的编写和管理。
|
17
|
+
|
18
|
+
> 注:目前只支持依赖 CocoaPods 管理的模块化工程。
|
19
|
+
|
20
|
+
我们借鉴 CocoaPods 的做法,开发团队只需要在主项目中加入一个 Bigkeeper 文件,然后利用我们提供的 `bigkeeper` 工具,即可更便捷的实现**代码分支**和**业务模块**的管理;另外,通过我们提供的工具,也能帮助开发者养成更规范的日常开发习惯,减轻项目管理者的负担。
|
21
|
+
|
22
|
+
## 应用场景
|
23
|
+
|
24
|
+
在模块化项目的过渡阶段,我们往往会碰到业务拆分不是那么彻底的情况(PS:比如主项目中仍然存在业务相关代码),这样就会导致一系列问题:
|
25
|
+
|
26
|
+
- 开发者开发一个 feature 时需要维护多个项目的分支,同时还要频繁修改主项目的 `Podfile`;
|
27
|
+
- 项目管理者需要花很大精力去和团队成员同步项目管理规范流程,尤其对于新人,挑战很大;
|
28
|
+
- 开发过程中如果碰到突发情况需要开新分支处理问题时对当前工作区的保存操作会很繁琐(PS:因为涉及到多个项目);
|
29
|
+
- 日常开发过程中类似 commit、pull、push 等操作比较繁琐(PS:因为涉及到多个项目)。
|
30
|
+
|
31
|
+
bigkeeper 的出现就是为了解决这些问题。
|
32
|
+
|
33
|
+
> 注:也有很多人认为直接做一个完整的组件化项目更合理,而不需要采用这样曲折的方案,但是很多时候我们并没有这么多的精力直接去做这些事情,bigkeeper 存在的价值也是为了帮助开发团队在** iOS&Android 模块化项目过渡阶段**能更轻松的往前走。
|
15
34
|
|
16
|
-
##
|
35
|
+
## 安装
|
17
36
|
|
18
|
-
|
37
|
+
- 当作 Ruby Gem 使用:
|
38
|
+
在项目的 Gemfile 中加入下面这行:
|
19
39
|
|
20
|
-
```ruby
|
21
|
-
gem 'big_keeper'
|
22
|
-
```
|
40
|
+
```ruby
|
41
|
+
gem 'big_keeper'
|
42
|
+
```
|
23
43
|
|
24
|
-
|
44
|
+
然后执行:
|
25
45
|
|
26
46
|
$ bundle
|
27
47
|
|
28
|
-
|
48
|
+
- 直接安装:
|
29
49
|
|
30
50
|
$ gem install big_keeper
|
31
51
|
|
32
|
-
##
|
52
|
+
## 使用方法
|
53
|
+
|
54
|
+
> 注:每个流程我们都提供详细的流程图来让你了解我们都做了些什么,为了方便你更好的了解我们的流程,我们提供了一个流程参考图,如下:
|
55
|
+
>
|
56
|
+
> ![](./resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.001.jpeg)
|
57
|
+
|
58
|
+
- [Bigkeeper 文件配置](./docs/zh-CN/BIGKEEPER_FILE.md)
|
59
|
+
- `bigkeeper` 工具使用:
|
60
|
+
|
61
|
+
直接在命令行执行 `bigkeeper` 可以查看其提供的所有功能:
|
62
|
+
|
63
|
+
```
|
64
|
+
NAME
|
65
|
+
bigkeeper - Efficiency improvement for iOS&Android modular development, iOSer&Android using this tool can make modular development easier.
|
66
|
+
|
67
|
+
SYNOPSIS
|
68
|
+
bigkeeper [global options] command [command options] [arguments...]
|
69
|
+
|
70
|
+
GLOBAL OPTIONS
|
71
|
+
--help - Show this message
|
72
|
+
-p, --path=arg - (default: ./)
|
73
|
+
-u, --user=arg - (default: mmoaay)
|
74
|
+
|
75
|
+
-v, --ver=arg - (default: Version in Bigkeeper file)
|
76
|
+
|
77
|
+
COMMANDS
|
78
|
+
feature - Feature operations
|
79
|
+
help - Shows a list of commands or help for one command
|
80
|
+
hotfix - Hotfix operations
|
81
|
+
podfile - Podfile operation
|
82
|
+
release - Release operations
|
83
|
+
version - Version
|
84
|
+
```
|
33
85
|
|
34
|
-
|
86
|
+
全局参数如下:
|
35
87
|
|
36
|
-
|
88
|
+
- -p, --path:主项目所在的目录,默认是执行 bigkeeper 命令的当前目录;
|
89
|
+
- -v, --ver:版本号,如果没有指定的话,会以主项目 [Bigkeeper 文件](BIGKEEPER_FILE.md)中指定的版本为准。
|
90
|
+
- -u, --user:用户名,默认是 git global config 的 user.name,会显示在命令提示信息中,比如上述提示信息中的默认用户名是 mmoaay
|
37
91
|
|
38
|
-
|
92
|
+
功能列表如下:
|
39
93
|
|
40
|
-
|
94
|
+
- [feature](./docs/zh-CN/FEATURE&HOTFIX.md):功能开发流程;
|
95
|
+
- [hotfix](./docs/zh-CN/FEATURE&HOTFIX.md):线上修复流程;
|
96
|
+
- [release](./docs/zh-CN/RELEASE.md):发布流程;
|
97
|
+
- [podfile](./docs/zh-CN/PODFILE.md):Podfile 操作流程;
|
98
|
+
- version:查看 bigkeeper 当前版本号;
|
99
|
+
- help:查看 bigkeeper 帮助文档。
|
41
100
|
|
42
|
-
##
|
101
|
+
## 其他
|
43
102
|
|
44
|
-
|
103
|
+
- [一些建议](./docs/zh-CN/RECOMMEND.md)
|
45
104
|
|
46
|
-
##
|
105
|
+
## 协议
|
47
106
|
|
48
107
|
![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)
|
49
108
|
|
50
|
-
|
109
|
+
bigkeeper 基于 MIT 协议进行分发和使用,更多信息参见协议文件。
|
File without changes
|
@@ -0,0 +1,50 @@
|
|
1
|
+
[中文](../zh-CN/README.md)
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
# bigkeeper - All in home project
|
6
|
+
|
7
|
+
[![Build Status](https://travis-ci.org/BigKeeper/bigkeeper.svg?branch=master)](https://travis-ci.org/BigKeeper/bigkeeper)
|
8
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/c6dc4161e84fcec9a890/maintainability)](https://codeclimate.com/github/BigKeeper/big-keeper/maintainability)
|
9
|
+
[![Gem Version](https://badge.fury.io/rb/big_keeper.svg)](https://rubygems.org/gems/big_keeper)
|
10
|
+
[![Language: Ruby](https://img.shields.io/badge/language-Ruby-da212f.svg)](https://www.ruby-lang.org/)
|
11
|
+
[![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/BigKeeper/big-keeper/blob/master/LICENSE)
|
12
|
+
[![Gitter](https://img.shields.io/gitter/room/BigKeeper/BigKeeper.svg)](https://gitter.im/Big-Keeper/Lobby)
|
13
|
+
|
14
|
+
bigkeeper is an efficiency improvement for iOS&Android modular development, iOSer&Android using this tool can make modular development easier.
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'big_keeper'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install big_keeper
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
Run `bigkeeper` to learn how to use bigkeeper.
|
35
|
+
|
36
|
+
## Development
|
37
|
+
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
39
|
+
|
40
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/BigKeeper/bigkeeper.
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)
|
49
|
+
|
50
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Bigkeeper 文件
|
2
2
|
|
3
|
-
首先,我们在主项目 Podfile 所在的目录加入
|
3
|
+
首先,我们在主项目 Podfile 所在的目录加入 **Bigkeeper** 文件。
|
4
4
|
|
5
5
|
## 配置版本
|
6
6
|
|
@@ -59,4 +59,4 @@ end
|
|
59
59
|
>
|
60
60
|
> 2. 默认我们会把本地路径配置成 `../{业务模块在 Podfile 中的名字}` 的形式,因为大部分情况下,我们会把项目都放在同级目录下,这也是我们推荐的;
|
61
61
|
>
|
62
|
-
> 3. 另外,在使用
|
62
|
+
> 3. 另外,在使用 bigkeeper 相关功能时,如果某些业务模块并没有 clone 到本地,bigkeeper 会根据之前配置的业务模块远程 git 地址 clone 业务模块仓库到**主项目同级目录下**。
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# feature - 功能开发流程 & hotfix - 线上修复流程
|
2
|
+
|
3
|
+
> 注:hotfix 除了基础分支是 **master**,其他操作和 feature 一致,所以我们这里以 feature 为例说明。
|
4
|
+
|
5
|
+
直接在命令行执行 `bigkeeper feature --help` 可以查看其提供的所有功能:
|
6
|
+
|
7
|
+
```
|
8
|
+
NAME
|
9
|
+
feature - Feature operations
|
10
|
+
|
11
|
+
|
12
|
+
SYNOPSIS
|
13
|
+
bigkeeper [global options] feature delete
|
14
|
+
bigkeeper [global options] feature finish
|
15
|
+
bigkeeper [global options] feature list
|
16
|
+
bigkeeper [global options] feature pull
|
17
|
+
bigkeeper [global options] feature push
|
18
|
+
bigkeeper [global options] feature start
|
19
|
+
bigkeeper [global options] feature switch
|
20
|
+
bigkeeper [global options] feature update
|
21
|
+
|
22
|
+
COMMANDS
|
23
|
+
delete - Delete feature with name
|
24
|
+
finish - Finish current feature
|
25
|
+
list - List all the features
|
26
|
+
pull - Pull remote changes for current feature
|
27
|
+
push - Push local changes to remote for current feature
|
28
|
+
start - Start a new feature with name for given modules and main project
|
29
|
+
switch - Switch to the feature with name
|
30
|
+
update - Update modules for the feature with name
|
31
|
+
```
|
32
|
+
|
33
|
+
功能列表如下:
|
34
|
+
|
35
|
+
- start:
|
36
|
+
开始一个新的 feature,输入参数依次为:
|
37
|
+
- feature 的名字;
|
38
|
+
- 开发该 feature 需要改动的业务模块名。可以多个,用空格隔开;如果不指定,取 **Bigkeeper 文件中所有的业务模块名**。
|
39
|
+
- finish:结束当前 feature;
|
40
|
+
- switch:切换到一个已经存在的 feature,输入参数为 feature 名;
|
41
|
+
- update:
|
42
|
+
更新一个 feature 需要改动的业务模块,输入参数依次为:
|
43
|
+
- feature 的名字;
|
44
|
+
- 开发该 feature 需要改动的业务模块名。可以多个,用空格隔开;如果不指定,取 **Bigkeeper 文件中所有的业务模块名**。
|
45
|
+
- pull:拉取当前 feature 主项目和业务模块的远程 git 仓库更新;
|
46
|
+
- push:提交并推送当前 feature 主项目和业务模块的本地变更到远程 git 仓库,输入参数为提交信息;
|
47
|
+
- delete:根据 featue 名删除主项目和业务模块所有相关分支;(PS:慎用,因为会删除本地和远程所有相关分支)
|
48
|
+
- list:显示当前的 feature 列表。
|
49
|
+
|
50
|
+
## 各个流程的使用场景
|
51
|
+
|
52
|
+
- 如果需要开发新的功能,使用 bigkeeper feature start;
|
53
|
+
- 开发功能过程中如果发现某个模块其实不用改动,使用 bigkeeper feature update 来把这个模块从这个 feature 移除;
|
54
|
+
- 使用 bigkeeper feature pull 来同步主项目和相关业务模块远端变更;
|
55
|
+
- 使用 bigkeeper feature push 来推送主项目和相关业务模块变更到远端;
|
56
|
+
- 使用 bigkeeper feature switch 来切换 feature,比如:两个功能并行开发的时候,就可以用这个命令互相切换了;
|
57
|
+
- 功能开发完成,需要提交 PR 时,使用 bigkeeper feature finish 结束开发;
|
58
|
+
- 如果开发过程中突然有新的功能需要紧急开发,直接使用 bigkeeper feature start 进行新功能开发,旧功能未提交的内容我们会保存在 stash 中。
|
59
|
+
|
60
|
+
## feature 的工作区
|
61
|
+
|
62
|
+
![](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.002.jpeg)
|
63
|
+
|
64
|
+
feature 的工作区主要由两部分组成:
|
65
|
+
|
66
|
+
- 主项目;
|
67
|
+
- 相关业务模块,我们把 Podfile 中引用方式为 `:path => {业务模块本地路径}` 的模块做为相关业务模块。
|
68
|
+
|
69
|
+
主项目和每个相关业务模块又有各自的工作区,由三个部分组成:
|
70
|
+
|
71
|
+
- 当前代码区改动;
|
72
|
+
- stash 缓存区,当用户需要切换新的 feature 时,对于用户来不及提交的改动,我们会缓存到各个项目的 stash 中,(PS:所以代码突然不见了不要担心,都在 git 的 stash 里面),而当用户切换回某个 feature 时,我们会把和该 feature 分支同名的 stash 恢复回来,从而使用户可以继续开发之前未完成的部分,因为需要通过 feature 的分支名来匹配 stash,而 git stash 又没有提供给 stash 命名的功能,所以我们实现了 [big-stash](https://github.com/BigKeeper/big-stash) 来完成这个功能;
|
73
|
+
- git。
|
74
|
+
|
75
|
+
## 工作区缓存流程
|
76
|
+
|
77
|
+
![stash 当前工作区](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.003.jpeg)
|
78
|
+
|
79
|
+
## master/develop 分支状态检查流程
|
80
|
+
|
81
|
+
![检查 master/develop 分支状态](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.004.jpeg)
|
82
|
+
|
83
|
+
## 切换分支流程
|
84
|
+
|
85
|
+
![切换分支](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.005.jpeg)
|
86
|
+
|
87
|
+
## 同步业务模块与主项目分支流程
|
88
|
+
|
89
|
+
![同步业务模块与主项目分支](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.006.jpeg)
|
90
|
+
|
91
|
+
## finish 业务模块 feature/hotfix 流程
|
92
|
+
|
93
|
+
![finish 业务模块 feature/hotfix](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.007.jpeg)
|
94
|
+
|
95
|
+
## 从 feature/hotfix 移除模块流程
|
96
|
+
|
97
|
+
![从 feature/hotfix 移除模块](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.008.jpeg)
|
98
|
+
|
99
|
+
## feature start 流程
|
100
|
+
|
101
|
+
![start](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.009.jpeg)
|
102
|
+
|
103
|
+
## feature finish 流程
|
104
|
+
|
105
|
+
![finish](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.010.jpeg)
|
106
|
+
|
107
|
+
## feature switch 流程
|
108
|
+
|
109
|
+
![switch](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.011.jpeg)
|
110
|
+
|
111
|
+
## feature update 流程
|
112
|
+
|
113
|
+
![update](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.012.jpeg)
|
114
|
+
|
115
|
+
## feature pull 流程
|
116
|
+
|
117
|
+
![pull](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.013.jpeg)
|
118
|
+
|
119
|
+
## feature push 流程
|
120
|
+
|
121
|
+
![push](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.014.jpeg)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# podfile - podfile版本控制流程
|
2
|
+
|
3
|
+
直接在命令行执行 `bigkeeper podfile --help` 可以查看其提供的所有功能
|
4
|
+
|
5
|
+
```
|
6
|
+
NAME
|
7
|
+
podfile - Podfile operation
|
8
|
+
|
9
|
+
SYNOPSIS
|
10
|
+
bigkeeper [global options] podfile [command options] detect
|
11
|
+
bigkeeper [global options] podfile [command options] lock
|
12
|
+
bigkeeper [global options] podfile [command options] upgrade
|
13
|
+
|
14
|
+
COMMAND OPTIONS
|
15
|
+
--pod, --podfile=arg - (default: none)
|
16
|
+
|
17
|
+
COMMANDS
|
18
|
+
detect - Detect podname should be locked.
|
19
|
+
lock - Lock podname should be locked.
|
20
|
+
upgrade - Update module version
|
21
|
+
|
22
|
+
```
|
23
|
+
|
24
|
+
全局参数如下:
|
25
|
+
|
26
|
+
- -pod --podfile :podfile文件路径
|
27
|
+
|
28
|
+
功能列表如下:
|
29
|
+
|
30
|
+
- detect:
|
31
|
+
检测当前同步到本地的项目工程中podfile,得到未锁定的第三方库。
|
32
|
+
如果存在,提示需要指定版本。
|
33
|
+
如果不存在,提示无需指定版本的第三方库。
|
34
|
+
|
35
|
+
- lock:
|
36
|
+
检测到存在需指定代版本的三方库后,执行lock指令对所有需要锁定的库进行锁定。
|
37
|
+
|
38
|
+
- upgrade:
|
39
|
+
检测配置文件中指定业务库,有无最新可更新版本。
|
40
|
+
|
41
|
+
## podfile lock 流程
|
42
|
+
|
43
|
+
![](../../resources/readme/big-keeper-readme.011.png)
|
data/docs/zh-CN/README.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
[English](
|
1
|
+
[English](../en-US/README.md)
|
2
2
|
|
3
3
|
---
|
4
4
|
|
5
|
-
#
|
5
|
+
# bigkeeper
|
6
6
|
|
7
|
-
[![Build Status](https://travis-ci.org/BigKeeper/
|
7
|
+
[![Build Status](https://travis-ci.org/BigKeeper/bigkeeper.svg?branch=master)](https://travis-ci.org/BigKeeper/bigkeeper)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/c6dc4161e84fcec9a890/maintainability)](https://codeclimate.com/github/BigKeeper/big-keeper/maintainability)
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/big_keeper.svg)](https://rubygems.org/gems/big_keeper)
|
10
10
|
[![Language: Ruby](https://img.shields.io/badge/language-Ruby-da212f.svg)](https://www.ruby-lang.org/)
|
11
11
|
[![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/BigKeeper/big-keeper/blob/master/LICENSE)
|
12
12
|
[![Gitter](https://img.shields.io/gitter/room/BigKeeper/BigKeeper.svg)](https://gitter.im/Big-Keeper/Lobby)
|
13
13
|
|
14
|
-
|
14
|
+
bigkeeper 是一个 **iOS&Android 模块化项目**效率提升工具,使用这个工具后,开发者**在主项目内**即可完成**包括其他业务模块在内**所有代码的编写和管理。
|
15
15
|
|
16
16
|
> 注:目前只支持依赖 CocoaPods 管理的模块化工程。
|
17
17
|
|
18
|
-
|
18
|
+
我们借鉴 CocoaPods 的做法,开发团队只需要在主项目中加入一个 Bigkeeper 文件,然后利用我们提供的 `bigkeeper` 工具,即可更便捷的实现**代码分支**和**业务模块**的管理;另外,通过我们提供的工具,也能帮助开发者养成更规范的日常开发习惯,减轻项目管理者的负担。
|
19
19
|
|
20
20
|
## 应用场景
|
21
21
|
|
@@ -26,9 +26,9 @@ big-keeper 是一个**iOS模块化项目过渡阶段**的效率提升工具,
|
|
26
26
|
- 开发过程中如果碰到突发情况需要开新分支处理问题时对当前工作区的保存操作会很繁琐(PS:因为涉及到多个项目);
|
27
27
|
- 日常开发过程中类似 commit、pull、push 等操作比较繁琐(PS:因为涉及到多个项目)。
|
28
28
|
|
29
|
-
|
29
|
+
bigkeeper 的出现就是为了解决这些问题。
|
30
30
|
|
31
|
-
> 注:也有很多人认为直接做一个完整的组件化项目更合理,而不需要采用这样曲折的方案,但是很多时候我们并没有这么多的精力直接去做这些事情,
|
31
|
+
> 注:也有很多人认为直接做一个完整的组件化项目更合理,而不需要采用这样曲折的方案,但是很多时候我们并没有这么多的精力直接去做这些事情,bigkeeper 存在的价值也是为了帮助开发团队在 **iOS&Android 模块化项目过渡阶段**能更轻松的往前走。
|
32
32
|
|
33
33
|
## 安装
|
34
34
|
|
@@ -49,41 +49,59 @@ big-keeper 的出现就是为了解决这些问题。
|
|
49
49
|
|
50
50
|
## 使用方法
|
51
51
|
|
52
|
+
> 注:每个流程我们都提供详细的流程图来让你了解我们都做了些什么,为了方便你更好的了解我们的流程,我们提供了一个流程参考图,如下:
|
53
|
+
>
|
54
|
+
> ![](../../resources/keynote/big-keeper-readme-feature/big-keeper-readme-feature.001.jpeg)
|
55
|
+
|
52
56
|
- [Bigkeeper 文件配置](BIGKEEPER_FILE.md)
|
53
|
-
- `
|
57
|
+
- `bigkeeper` 工具使用:
|
54
58
|
|
55
|
-
直接在命令行执行 `
|
59
|
+
直接在命令行执行 `bigkeeper` 可以查看其提供的所有功能:
|
56
60
|
|
57
61
|
```
|
58
62
|
NAME
|
59
|
-
|
63
|
+
bigkeeper - Efficiency improvement for iOS&Android modular development, iOSer&Android using this tool can make modular development easier.
|
60
64
|
|
61
65
|
SYNOPSIS
|
62
|
-
|
66
|
+
bigkeeper [global options] command [command options] [arguments...]
|
63
67
|
|
64
68
|
GLOBAL OPTIONS
|
65
69
|
--help - Show this message
|
66
70
|
-p, --path=arg - (default: ./)
|
71
|
+
-u, --user=arg - (default: mmoaay)
|
72
|
+
|
67
73
|
-v, --ver=arg - (default: Version in Bigkeeper file)
|
68
74
|
|
69
75
|
COMMANDS
|
70
76
|
feature - Feature operations
|
71
77
|
help - Shows a list of commands or help for one command
|
78
|
+
hotfix - Hotfix operations
|
79
|
+
podfile - Podfile operation
|
72
80
|
release - Release operations
|
81
|
+
version - Version
|
73
82
|
```
|
74
83
|
|
75
84
|
全局参数如下:
|
76
85
|
|
77
|
-
- -p, --path:主项目所在的目录,默认是执行
|
86
|
+
- -p, --path:主项目所在的目录,默认是执行 bigkeeper 命令的当前目录;
|
78
87
|
- -v, --ver:版本号,如果没有指定的话,会以主项目 [Bigkeeper 文件](BIGKEEPER_FILE.md)中指定的版本为准。
|
88
|
+
- -u, --user:用户名,默认是 git global config 的 user.name,会显示在命令提示信息中,比如上述提示信息中的默认用户名是 mmoaay
|
79
89
|
|
80
90
|
功能列表如下:
|
81
91
|
|
82
|
-
- [feature](FEATURE.md):功能开发流程;
|
83
|
-
- [
|
92
|
+
- [feature](FEATURE&HOTFIX.md):功能开发流程;
|
93
|
+
- [hotfix](FEATURE&HOTFIX.md):线上修复流程;
|
94
|
+
- [release](RELEASE.md):发布流程;
|
95
|
+
- [podfile](PODFILE.md):Podfile 操作流程;
|
96
|
+
- version:查看 bigkeeper 当前版本号;
|
97
|
+
- help:查看 bigkeeper 帮助文档。
|
98
|
+
|
99
|
+
## 其他
|
100
|
+
|
101
|
+
- [一些建议](RECOMMEND.md)
|
84
102
|
|
85
103
|
## 协议
|
86
104
|
|
87
105
|
![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)
|
88
106
|
|
89
|
-
|
107
|
+
bigkeeper 基于 MIT 协议进行分发和使用,更多信息参见协议文件。
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# 代码管理规范
|
2
|
+
|
3
|
+
## 基本原则
|
4
|
+
|
5
|
+
- master 分支保证是线上最新包的代码。
|
6
|
+
- develop 分支保证是下一个发布包的代码,随时支持发布。
|
7
|
+
|
8
|
+
### 开发和测试流程
|
9
|
+
|
10
|
+
feature 分支为 feature 开发和提测分支,提测前需要 rebase/merge develop 的代码,测试完成后,pr 到 develop 分支,确定下个版本发布才 accept pr。
|
11
|
+
|
12
|
+
### develop 分支 bug 修复流程
|
13
|
+
|
14
|
+
单独开分支,fix 完成后,pr 到 develop 分支。
|
15
|
+
|
16
|
+
### 发布流程
|
17
|
+
|
18
|
+
develop->release->master 瞬间操作,release 不能长期存在。
|
19
|
+
|
20
|
+
### hotfix 流程
|
21
|
+
|
22
|
+
master 拉出 hotfix,fix 完成后分别 pr 到 master、develop 两个分支,完成后新建发布版本。
|
data/docs/zh-CN/RELEASE.md
CHANGED
@@ -27,14 +27,17 @@ COMMANDS
|
|
27
27
|
- start: 开始发布主工程的某个版本
|
28
28
|
- finish: 完成发布版本
|
29
29
|
- module: 发布模块命令
|
30
|
+
- start: 开始发布模块的某个版本
|
31
|
+
- finish: 完成发布版本
|
30
32
|
|
31
33
|
## release 的工作区
|
32
34
|
同 feature 工作区
|
33
35
|
|
34
36
|
## release home start 流程
|
35
|
-
![](../../resources/readme/big-keeper-readme.008.
|
37
|
+
![](../../resources/readme/big-keeper-readme.008.png)
|
36
38
|
## release home finish 流程
|
37
|
-
![](../../resources/readme/big-keeper-readme.009.
|
38
|
-
## release module 流程
|
39
|
-
![](../../resources/readme/big-keeper-readme.010.
|
40
|
-
|
39
|
+
![](../../resources/readme/big-keeper-readme.009.png)
|
40
|
+
## release module start 流程
|
41
|
+
![](../../resources/readme/big-keeper-readme.010.png)
|
42
|
+
## release module finish 流程
|
43
|
+
![](../../resources/readme/big-keeper-readme.012.png)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'big_keeper/util/podfile_operator'
|
4
|
+
require 'big_keeper/util/gitflow_operator'
|
5
|
+
require 'big_keeper/util/bigkeeper_parser'
|
6
|
+
require 'big_keeper/util/logger'
|
7
|
+
require 'big_keeper/util/pod_operator'
|
8
|
+
|
9
|
+
require 'big_keeper/model/podfile_type'
|
10
|
+
|
11
|
+
require 'big_keeper/service/stash_service'
|
12
|
+
require 'big_keeper/service/module_service'
|
13
|
+
|
14
|
+
|
15
|
+
module BigKeeper
|
16
|
+
def self.delete(path, user, name, type)
|
17
|
+
begin
|
18
|
+
# Parse Bigkeeper file
|
19
|
+
BigkeeperParser.parse("#{path}/Bigkeeper")
|
20
|
+
branch_name = "#{GitflowType.name(type)}/#{name}"
|
21
|
+
|
22
|
+
modules = BigkeeperParser.module_names
|
23
|
+
|
24
|
+
modules.each do |module_name|
|
25
|
+
module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
|
26
|
+
GitService.new.verify_del(module_full_path, branch_name, module_name, type)
|
27
|
+
end
|
28
|
+
|
29
|
+
GitService.new.verify_del(path, branch_name, 'Home', type)
|
30
|
+
ensure
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -10,39 +10,40 @@ require 'big_keeper/model/podfile_type'
|
|
10
10
|
|
11
11
|
module BigKeeper
|
12
12
|
|
13
|
-
def self.
|
13
|
+
def self.finish(path, user, type)
|
14
14
|
begin
|
15
15
|
# Parse Bigkeeper file
|
16
16
|
BigkeeperParser.parse("#{path}/Bigkeeper")
|
17
17
|
|
18
18
|
modules = PodfileOperator.new.modules_with_type("#{path}/Podfile",
|
19
19
|
BigkeeperParser.module_names, ModuleType::PATH)
|
20
|
-
|
21
20
|
branch_name = GitOperator.new.current_branch(path)
|
22
|
-
|
21
|
+
|
22
|
+
Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
|
23
23
|
|
24
24
|
# Rebase modules and modify podfile as git
|
25
25
|
modules.each do |module_name|
|
26
|
-
ModuleService.new.finish(path, user, module_name)
|
26
|
+
ModuleService.new.finish(path, user, module_name, branch_name, type)
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
Logger.highlight("Finish branch '#{branch_name}' for 'Home'")
|
30
|
+
|
31
|
+
# pod install
|
32
|
+
PodOperator.pod_install(path)
|
33
|
+
|
34
|
+
modules.each do |module_name|
|
30
35
|
module_git = BigkeeperParser.module_git(module_name)
|
31
36
|
PodfileOperator.new.find_and_replace("#{path}/Podfile",
|
32
37
|
module_name,
|
33
38
|
ModuleType::GIT,
|
34
|
-
GitInfo.new(module_git, GitType::BRANCH,
|
39
|
+
GitInfo.new(module_git, GitType::BRANCH, GitflowType.base_branch(type)))
|
35
40
|
end
|
36
41
|
|
37
|
-
# pod install
|
38
|
-
PodOperator.pod_install(path)
|
39
|
-
|
40
|
-
Logger.highlight("Finish branch '#{branch_name}' for 'Home'")
|
41
42
|
# Push home changes to remote
|
42
|
-
GitService.new.verify_push(path, "finish
|
43
|
+
GitService.new.verify_push(path, "finish branch #{branch_name}", branch_name, 'Home')
|
43
44
|
|
44
45
|
# Rebase Home
|
45
|
-
GitService.new.verify_rebase(path,
|
46
|
+
GitService.new.verify_rebase(path, GitflowType.base_branch(type), 'Home')
|
46
47
|
|
47
48
|
`open #{BigkeeperParser.home_pulls()}`
|
48
49
|
ensure
|
@@ -1,19 +1,19 @@
|
|
1
1
|
require 'big_keeper/util/logger'
|
2
2
|
|
3
3
|
module BigKeeper
|
4
|
-
def self.
|
4
|
+
def self.pull(path, user, type)
|
5
5
|
begin
|
6
6
|
# Parse Bigkeeper file
|
7
7
|
BigkeeperParser.parse("#{path}/Bigkeeper")
|
8
|
-
|
9
8
|
branch_name = GitOperator.new.current_branch(path)
|
10
|
-
|
9
|
+
|
10
|
+
Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
|
11
11
|
|
12
12
|
modules = PodfileOperator.new.modules_with_type("#{path}/Podfile",
|
13
13
|
BigkeeperParser.module_names, ModuleType::PATH)
|
14
14
|
|
15
15
|
modules.each do |module_name|
|
16
|
-
ModuleService.new.pull(path, user, module_name, branch_name)
|
16
|
+
ModuleService.new.pull(path, user, module_name, branch_name, type)
|
17
17
|
end
|
18
18
|
|
19
19
|
Logger.highlight("Pull branch '#{branch_name}' for 'Home'...")
|