dngg 0.0.7 → 1.0.0
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/lib/dngg/command/merge.rb +8 -7
- data/lib/dngg/command/mr.rb +10 -2
- data/lib/dngg/hook/commit-msg +3 -0
- data/lib/dngg/util/submodule.rb +1 -2
- data/lib/dngg/version.rb +1 -1
- data/lib/dngg.rb +5 -5
- 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: 536740e8f6ec1c466c0e89e86f6ae018838567078e83a694649895a4146e8e14
|
4
|
+
data.tar.gz: a9024ad1877be60d8ce1c193bd6d75dcdc76ce31ccaaa95a21dbc8f4a86b20c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55e30407957768302ab371429d73d8084bba07677425259ccfddcaefcb074094a95bd9e67b7ddb9c72ba51a1ebf94579f04d35cf8e821139a56ba3731f4e168c
|
7
|
+
data.tar.gz: f7e1ca15f3421095b6cfc0f3cc5cf682e65e851d5988ee8d9a55e7862550e97ebe7bf85ebffe0acda1375f4175f3487a301abdeeb7ba13806e0a42f8316f8f37
|
data/Gemfile.lock
CHANGED
data/lib/dngg/command/merge.rb
CHANGED
@@ -29,13 +29,14 @@ module DNGG
|
|
29
29
|
`git fetch | grep 'ignored'`
|
30
30
|
end
|
31
31
|
|
32
|
-
if need_rebase(branch) || force_rebase
|
33
|
-
|
34
|
-
|
35
|
-
else
|
36
|
-
|
37
|
-
|
38
|
-
end
|
32
|
+
# if need_rebase(branch) || force_rebase
|
33
|
+
# process_rebase(arry_conflict, branch)
|
34
|
+
# puts 'Tip: 主工程rebase模式'.blue
|
35
|
+
# else
|
36
|
+
# process_merge(arry_conflict, '主工程', branch)
|
37
|
+
# puts 'Tip: 主工程merge模式'.blue
|
38
|
+
# end
|
39
|
+
process_merge(arry_conflict, '主工程', branch)
|
39
40
|
|
40
41
|
if arry_conflict.size > 0
|
41
42
|
tip = "==> #{arry_conflict.size}个模块冲突:"
|
data/lib/dngg/command/mr.rb
CHANGED
@@ -18,8 +18,9 @@ module DNGG
|
|
18
18
|
@@msg = ''
|
19
19
|
@@urls = {}
|
20
20
|
@@user = ''
|
21
|
+
@@assign = ''
|
21
22
|
|
22
|
-
def mr_flow(target_branch, msg)
|
23
|
+
def mr_flow(target_branch, name, msg)
|
23
24
|
check_submodule(false)
|
24
25
|
|
25
26
|
@@current_branch = get_current_branch
|
@@ -33,6 +34,12 @@ module DNGG
|
|
33
34
|
@@token = init_check_token
|
34
35
|
@@msg = msg
|
35
36
|
|
37
|
+
git_id = Hash["luwenjun" => 1526, "zhuruixue" => 1859,"hehongqing"=> 1949, "machenfei"=> 2199,"tanhua"=> 2031,"wulei"=> 2014, "yangyanpeng"=> 1865,"yangfan"=> 1928,"yuezhiyu"=> 2569]
|
38
|
+
|
39
|
+
@@assign = git_id[name]
|
40
|
+
if @@assign.nil?
|
41
|
+
@@assign = git_id['luwenjun']
|
42
|
+
end
|
36
43
|
foreach_module {|sub|
|
37
44
|
create_mr(sub)
|
38
45
|
}
|
@@ -95,7 +102,8 @@ module DNGG
|
|
95
102
|
params['source_branch'] = @@current_branch
|
96
103
|
params['target_branch'] = @@target_branch
|
97
104
|
params['title'] = @@msg
|
98
|
-
|
105
|
+
params['assignee_id'] = @@assign
|
106
|
+
|
99
107
|
uri = URI.parse("https://gitlab.qima-inc.com/api/v4/projects/#{project_name}/merge_requests?private_token=#{@@token}")
|
100
108
|
response = Net::HTTP.post_form(uri, params)
|
101
109
|
result = Oj.load(response.body)
|
data/lib/dngg/hook/commit-msg
CHANGED
@@ -8,6 +8,7 @@ def commit_check
|
|
8
8
|
standards.each do |standard|
|
9
9
|
check(standard)
|
10
10
|
end
|
11
|
+
puts @msg.red
|
11
12
|
puts '====> commit message不符合规范,请查看规范 https://naxg5qz90v.feishu.cn/wiki/wikcnGAC0ayqRw5SSyj6QFQESKb'.red
|
12
13
|
exit 1
|
13
14
|
end
|
@@ -15,6 +16,8 @@ end
|
|
15
16
|
def check(keyword)
|
16
17
|
if @msg.start_with? keyword
|
17
18
|
exit 0
|
19
|
+
else
|
20
|
+
puts keyword
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
data/lib/dngg/util/submodule.rb
CHANGED
@@ -16,12 +16,11 @@ module DNGG
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def get_submodule
|
19
|
-
pattern = /(?<=\s)[\/0-9a-zA-Z]*(?=\s)/
|
19
|
+
pattern = /(?<=\s)[\/0-9a-zA-Z\-]*(?=\s)/
|
20
20
|
|
21
21
|
sub_status = `git submodule`
|
22
22
|
sub_status = sub_status.split(/\n/)
|
23
23
|
match = pattern.match(sub_status[0])
|
24
|
-
|
25
24
|
if match==nil
|
26
25
|
puts '==> 初始化子模块'.yellow
|
27
26
|
`git submodule update --init --recursive`
|
data/lib/dngg/version.rb
CHANGED
data/lib/dngg.rb
CHANGED
@@ -34,8 +34,8 @@ module DNGG
|
|
34
34
|
start_flow(branch, action)
|
35
35
|
end
|
36
36
|
|
37
|
-
desc 'merge <branch>
|
38
|
-
option :rebase, :default => false, :type => :boolean, aliases: '-r'
|
37
|
+
desc 'merge <branch>', 'Merge,开发完成后执行'
|
38
|
+
# option :rebase, :default => false, :type => :boolean, aliases: '-r'
|
39
39
|
def merge(branch)
|
40
40
|
rebase = options[:rebase]
|
41
41
|
merge_flow(branch, rebase)
|
@@ -48,9 +48,9 @@ module DNGG
|
|
48
48
|
finish_flow(force)
|
49
49
|
end
|
50
50
|
|
51
|
-
desc 'mr <branch> <title>', '创建MR'
|
52
|
-
def mr(branch, title)
|
53
|
-
mr_flow(branch, title)
|
51
|
+
desc 'mr <branch> <name> <title>', '创建MR'
|
52
|
+
def mr(branch, name, title)
|
53
|
+
mr_flow(branch, name, title)
|
54
54
|
end
|
55
55
|
|
56
56
|
desc 'switch <branch>', '切换分支'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dngg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iSnow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|