kookeeper 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/big_keeper/command/feature&hotfix/start.rb +25 -11
- data/lib/big_keeper/command/feature&hotfix/update.rb +6 -1
- data/lib/big_keeper/service/git_service.rb +31 -5
- data/lib/big_keeper/service/stash_service.rb +17 -4
- data/lib/big_keeper/util/cache_operator.rb +1 -0
- data/lib/big_keeper/util/git_operator.rb +5 -0
- data/lib/big_keeper/util/pod_operator.rb +4 -3
- data/lib/big_keeper/util/xcode_operator.rb +3 -3
- data/lib/big_keeper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7718447d06913c05171af6d4ec81c0953c3d4d9e887459c985bc3ee9771dce7e
|
4
|
+
data.tar.gz: ac5205ec448541b9f18a290cf45d23bc040d9d0e541c8688b748d8b37382f76b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c76b56a8b141755cc2c50ad3a4932514d4eeec66149cfbf8a2829b8480cdb0a5ae873531b96aaae193098e0678efe714beb62a2ff16dc561f6332f076a7c16c6
|
7
|
+
data.tar.gz: 751772b95fb8e95f95ac6ffca60209846abac3a7fe9df09ee3f0cc611e45ed68c0623f47fe23caefc119b6ae402592986cf7f609ab90acf23a8c8a49ea61f382
|
data/Gemfile.lock
CHANGED
@@ -20,50 +20,64 @@ module BigKeeper
|
|
20
20
|
def self.start(path, version, user, name, modules, type)
|
21
21
|
begin
|
22
22
|
# Parse Bigkeeper file
|
23
|
+
p "----------1.开始解析#{path}/Bigkeeper"
|
23
24
|
BigkeeperParser.parse("#{path}/Bigkeeper")
|
24
25
|
|
25
26
|
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
27
|
+
|
28
|
+
p "----------2.version:#{version}"
|
26
29
|
full_name = "#{version}_#{user}_#{name}"
|
30
|
+
p "----------3.full_name:#{full_name}"
|
27
31
|
branch_name = "#{GitflowType.name(type)}/#{full_name}"
|
28
|
-
|
32
|
+
p "----------4.branch_name:#{branch_name}"
|
29
33
|
home_branch_name = "release/#{version}"
|
34
|
+
p "----------5.home_branch_name:#{home_branch_name}"
|
35
|
+
p "----------6.path:#{path}"
|
36
|
+
p "----------7.1验证home_branch"
|
30
37
|
GitService.new.verify_home_branch(path, branch_name, OperateType::START)
|
31
38
|
|
32
39
|
stash_modules = ModuleCacheOperator.new(path).all_path_modules
|
33
|
-
|
40
|
+
p "----------8.stash_modules:#{stash_modules}"
|
34
41
|
# Stash current branch
|
35
|
-
|
42
|
+
#
|
43
|
+
p "----------9.stash_all:path:#{path} branch_name:#{branch_name} user:#{user} #{path} stash_modules:#{stash_modules}"
|
44
|
+
StashService.new.stash_all(path, branch_name, user, stash_modules,version)
|
36
45
|
|
37
46
|
# Verify input modules
|
47
|
+
p "----------10.验证modules是否包含在Bigkeeper文件中"
|
38
48
|
modules = BigkeeperParser.verify_modules(modules)
|
39
|
-
|
40
|
-
Logger.highlight("Add branch release
|
49
|
+
p "----------11.home 添加 release/#{version} 分支"
|
50
|
+
Logger.highlight("Add branch release/#{version} for 'Home'...")
|
41
51
|
# Start home feature
|
42
52
|
# GitService.new.start(path, full_name, type)
|
43
53
|
GitService.new.startHome(path, version, GitflowType::RELEASE)
|
44
54
|
# Clean module cache
|
55
|
+
#
|
56
|
+
p "----------11.清空modules缓存"
|
45
57
|
ModuleCacheOperator.new(path).clean_modules
|
46
58
|
|
47
59
|
# Cache all path modules
|
60
|
+
p "----------Cache all path modules"
|
48
61
|
ModuleCacheOperator.new(path).cache_path_modules(modules, modules, [])
|
49
62
|
modules = ModuleCacheOperator.new(path).remain_path_modules
|
50
|
-
|
63
|
+
p "----------Backup home"
|
51
64
|
# Backup home
|
52
65
|
DepService.dep_operator(path, user).backup
|
53
66
|
|
67
|
+
p "----------Start modules feature and modify module as path"
|
54
68
|
# Start modules feature and modify module as path
|
55
69
|
modules.each do |module_name|
|
56
70
|
ModuleService.new.add(path, user, module_name, full_name, type)
|
57
71
|
end
|
58
|
-
|
72
|
+
p "----------install"
|
59
73
|
# install
|
60
|
-
DepService.dep_operator(path, user).install(
|
61
|
-
|
74
|
+
DepService.dep_operator(path, user).install(false )
|
75
|
+
p "----------Open home workspace"
|
62
76
|
# Open home workspace
|
63
77
|
DepService.dep_operator(path, user).open
|
64
|
-
|
78
|
+
p "----------Push home changes to remote"
|
65
79
|
# Push home changes to remote
|
66
|
-
Logger.highlight("Push branch
|
80
|
+
Logger.highlight("Push branch release/#{version} for 'Home'...")
|
67
81
|
GitService.new.verify_push(
|
68
82
|
path,
|
69
83
|
"init #{GitflowType.name(type)} #{full_name}",
|
@@ -23,7 +23,10 @@ module BigKeeper
|
|
23
23
|
BigkeeperParser.parse("#{path}/Bigkeeper")
|
24
24
|
branch_name = GitOperator.new.current_branch(path)
|
25
25
|
|
26
|
-
Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
|
26
|
+
# Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
|
27
|
+
|
28
|
+
Logger.error("Not a #{GitflowType.name(GitflowType::RELEASE)} branch, exit.") unless branch_name.include? GitflowType.name(GitflowType::RELEASE)
|
29
|
+
|
27
30
|
|
28
31
|
full_name = branch_name.gsub(/#{GitflowType.name(type)}\//, '')
|
29
32
|
|
@@ -45,6 +48,8 @@ module BigKeeper
|
|
45
48
|
if add_modules.empty? and del_modules.empty?
|
46
49
|
Logger.default("There is nothing changed with modules #{modules}.")
|
47
50
|
else
|
51
|
+
|
52
|
+
type =
|
48
53
|
# Modify podfile as path and Start modules feature
|
49
54
|
remain_path_modules.each do |module_name|
|
50
55
|
ModuleService.new.add(path, user, module_name, full_name, type)
|
@@ -9,21 +9,31 @@ module BigKeeper
|
|
9
9
|
class GitService
|
10
10
|
|
11
11
|
def startHome(path, name, type)
|
12
|
+
p "----------startHome"
|
12
13
|
git = GitOperator.new
|
13
14
|
branch_name = "#{GitflowType.name(type)}/#{name}"
|
15
|
+
p "----------branch_name:#{branch_name}"
|
14
16
|
if !git.has_remote_branch(path, branch_name) && !git.has_local_branch(path, branch_name)
|
15
|
-
|
17
|
+
p "----------如果远程和本地没有#{branch_name}分支"
|
16
18
|
verify_special_branch(path, 'master')
|
19
|
+
|
20
|
+
|
17
21
|
#verify_special_branch(path, 'develop')
|
18
22
|
|
19
|
-
GitflowOperator.new.verify_git_flow(path)
|
23
|
+
#GitflowOperator.new.verify_git_flow(path)
|
20
24
|
|
21
|
-
GitflowOperator.new.start(path, name, type)
|
25
|
+
#GitflowOperator.new.start(path, name, type)
|
26
|
+
#
|
27
|
+
Dir.chdir(path) do
|
28
|
+
p "git checkout -b #{branch_name}"
|
29
|
+
`git checkout -b #{branch_name}`
|
30
|
+
end
|
22
31
|
git.push_to_remote(path, branch_name)
|
23
32
|
else
|
24
33
|
verify_checkout(path, branch_name)
|
25
34
|
|
26
35
|
if !git.has_remote_branch(path, branch_name)
|
36
|
+
p "如果远程没有 #{branch_name}"
|
27
37
|
git.push_to_remote(path, branch_name)
|
28
38
|
end
|
29
39
|
end
|
@@ -42,6 +52,8 @@ module BigKeeper
|
|
42
52
|
GitflowOperator.new.verify_git_flow(path)
|
43
53
|
|
44
54
|
GitflowOperator.new.start(path, name, type)
|
55
|
+
|
56
|
+
verify_checkout(path, branch_name)
|
45
57
|
git.push_to_remote(path, branch_name)
|
46
58
|
else
|
47
59
|
verify_checkout(path, branch_name)
|
@@ -54,10 +66,13 @@ module BigKeeper
|
|
54
66
|
|
55
67
|
def verify_checkout(path, branch_name)
|
56
68
|
Dir.chdir(path) do
|
69
|
+
p "----------cd:#{path}"
|
57
70
|
cmd = "git checkout -b #{branch_name}"
|
58
71
|
if GitOperator.new.has_branch(path, branch_name)
|
72
|
+
p "有#{branch_name}"
|
59
73
|
cmd = "git checkout #{branch_name}"
|
60
74
|
end
|
75
|
+
p "cmd:#{cmd}"
|
61
76
|
IO.popen(cmd) do |io|
|
62
77
|
io.each do |line|
|
63
78
|
Logger.error("Checkout #{branch_name} failed.") if line.include? 'error'
|
@@ -73,26 +88,34 @@ module BigKeeper
|
|
73
88
|
|
74
89
|
def verify_special_branch(path, name)
|
75
90
|
git = GitOperator.new
|
76
|
-
|
91
|
+
p "----------检查#{name}分支"
|
77
92
|
if git.has_remote_branch(path, name)
|
93
|
+
p "--------------------有远程#{name}分支"
|
78
94
|
if git.has_local_branch(path, name)
|
95
|
+
p "------------------------------有本地#{name}分支"
|
79
96
|
if git.has_commits(path, name)
|
97
|
+
p "----------------------------------------有commits"
|
80
98
|
Logger.error(%Q('#{name}' has unpushed commits, you should fix it manually...))
|
81
99
|
end
|
100
|
+
p "------------------------------git pull"
|
82
101
|
pull(path, name)
|
83
102
|
else
|
103
|
+
p "------------------------------没有本地#{name}分支"
|
84
104
|
git.checkout(path, name)
|
85
105
|
end
|
86
106
|
else
|
107
|
+
p "--------------------没有远程#{name}分支"
|
87
108
|
verify_checkout(path, name)
|
88
109
|
git.push_to_remote(path, name)
|
89
110
|
end
|
90
111
|
end
|
91
112
|
|
92
113
|
def verify_home_branch(path, branch_name, type)
|
114
|
+
|
115
|
+
p "--------------------7.1.从远程同步本地分支"
|
93
116
|
Logger.highlight('Sync local branchs from remote, waiting...')
|
94
117
|
git = GitOperator.new
|
95
|
-
|
118
|
+
p "--------------------7.2.git fetch origin"
|
96
119
|
git.fetch(path)
|
97
120
|
|
98
121
|
if OperateType::START == type
|
@@ -149,6 +172,9 @@ module BigKeeper
|
|
149
172
|
def pull(path, branch_name)
|
150
173
|
git = GitOperator.new
|
151
174
|
current_branch_name = git.current_branch(path)
|
175
|
+
|
176
|
+
p "----------current_branch_name:#{current_branch_name}"
|
177
|
+
p "----------branch_name:#{branch_name}"
|
152
178
|
if current_branch_name == branch_name
|
153
179
|
git.pull(path)
|
154
180
|
else
|
@@ -22,24 +22,37 @@ module BigKeeper
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def stash_all(path, new_branch_name, user, modules)
|
25
|
+
def stash_all(path, new_branch_name, user, modules,version)
|
26
26
|
# Stash modules
|
27
27
|
Logger.highlight('Stash for current workspace...')
|
28
|
-
|
28
|
+
p "--------------------9.1.Stash modules----------"
|
29
29
|
modules.each do |module_name|
|
30
30
|
module_path = BigkeeperParser.module_full_path(path, user, module_name)
|
31
31
|
branch_name = GitOperator.new.current_branch(module_path)
|
32
32
|
|
33
|
+
p "------------------------------module_path:#{module_path}"
|
34
|
+
p "------------------------------branch_name:#{branch_name}"
|
35
|
+
p "------------------------------new_branch_name:#{new_branch_name}"
|
33
36
|
if branch_name != new_branch_name
|
34
37
|
stash(module_path, branch_name, module_name)
|
35
38
|
end
|
36
39
|
end
|
37
|
-
|
40
|
+
p "--------------------end Stash modules----------"
|
38
41
|
# Stash home
|
39
42
|
branch_name = GitOperator.new.current_branch(path)
|
40
|
-
|
43
|
+
p "--------------------9.2.Stash home----------"
|
44
|
+
|
45
|
+
|
46
|
+
home_branch_name = "release/#{version}"
|
47
|
+
|
48
|
+
p "------------------------------branch_name:#{branch_name}"
|
49
|
+
p "------------------------------home_branch_name:#{home_branch_name}"
|
50
|
+
|
51
|
+
if branch_name != home_branch_name
|
41
52
|
stash(path, branch_name, 'Home')
|
42
53
|
end
|
54
|
+
|
55
|
+
p "--------------------end Stash home----------"
|
43
56
|
end
|
44
57
|
end
|
45
58
|
end
|
@@ -41,6 +41,8 @@ module BigKeeper
|
|
41
41
|
|
42
42
|
def checkout(path, branch_name)
|
43
43
|
Dir.chdir(path) do
|
44
|
+
p "----------cd:#{path}"
|
45
|
+
p "----------git checkout #{branch_name}"
|
44
46
|
IO.popen("git checkout #{branch_name}") do |io|
|
45
47
|
io.each do |line|
|
46
48
|
Logger.error("Checkout #{branch_name} failed.") if line.include? 'error'
|
@@ -76,6 +78,7 @@ module BigKeeper
|
|
76
78
|
|
77
79
|
def push_to_remote(path, branch_name)
|
78
80
|
Dir.chdir(path) do
|
81
|
+
p "git push -u origin #{branch_name}"
|
79
82
|
`git push -u origin #{branch_name}`
|
80
83
|
end
|
81
84
|
GitOperator.new.check_push_success(path, branch_name, "origin/#{branch_name}")
|
@@ -83,6 +86,8 @@ module BigKeeper
|
|
83
86
|
|
84
87
|
def pull(path)
|
85
88
|
Dir.chdir(path) do
|
89
|
+
p "----------cd:#{path}"
|
90
|
+
p "----------git pull"
|
86
91
|
`git pull`
|
87
92
|
end
|
88
93
|
end
|
@@ -8,14 +8,14 @@ module BigKeeper
|
|
8
8
|
if repo_update
|
9
9
|
PodOperator.pod_update_private_repos(true)
|
10
10
|
end
|
11
|
-
Logger.highlight('Start pod
|
12
|
-
cmd = "pod
|
11
|
+
Logger.highlight('Start pod update, waiting...')
|
12
|
+
cmd = "pod update --project-directory='#{path}'"
|
13
13
|
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
|
14
14
|
while line = stdout.gets
|
15
15
|
p line
|
16
16
|
end
|
17
17
|
end
|
18
|
-
Logger.highlight('Finish pod
|
18
|
+
Logger.highlight('Finish pod update.')
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.pod_repo_push(path, module_name, source, version)
|
@@ -47,6 +47,7 @@ module BigKeeper
|
|
47
47
|
|
48
48
|
def self.pod_update_private_repos(update_private)
|
49
49
|
if update_private
|
50
|
+
p "BigkeeperParser.sources = #{BigkeeperParser.sources}"
|
50
51
|
BigkeeperParser.sources.map { |spec|
|
51
52
|
Logger.highlight('Start pod repo update, waiting...')
|
52
53
|
cmd = "pod repo update #{spec}"
|
@@ -4,12 +4,12 @@ module BigKeeper
|
|
4
4
|
class XcodeOperator
|
5
5
|
def self.open_workspace(path)
|
6
6
|
# Close Xcode
|
7
|
-
|
7
|
+
`pkill Xcode`
|
8
8
|
|
9
|
-
|
9
|
+
sleep 0.5
|
10
10
|
|
11
11
|
# Open home workspace
|
12
|
-
|
12
|
+
`open #{path}/*.xcworkspace`
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/lib/big_keeper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kookeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmoaay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|