dngg 0.0.4 → 0.0.5
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.rb +4 -1
- data/lib/dngg/command/mr.rb +5 -4
- data/lib/dngg/mr/email.rb +8 -5
- data/lib/dngg/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: ed83c69c8ffd9f281d9bda6d8d0a2534f5f543b80052dc9b445c49a99144ce5d
|
4
|
+
data.tar.gz: 2406d79be38a740e8ed633c4c89efab8ba1036d524405cdb8972e9a1136a15db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc0258704a57f9703daf63be525ca98f7b8065c4c392cbcd8814972116b5d9542439b829579011c3436da2d273830ad4eda4e236a0eaa686e72450af35301d21
|
7
|
+
data.tar.gz: df102c00a4c7b29081032559a9797f6f03a75d4226af1f71841c082f3c3f9ce9da4ccd61d077864f8a9533bbb4eb5ea8e7a09561bfb068e0e0833e0c4e2616ce
|
data/Gemfile.lock
CHANGED
data/lib/dngg.rb
CHANGED
data/lib/dngg/command/mr.rb
CHANGED
@@ -80,8 +80,8 @@ module DNGG
|
|
80
80
|
|
81
81
|
if current_branch_head_commit!="origin/#{@@current_branch}" && # 判断远程分支是否存在
|
82
82
|
get_head_commit("origin/#{@@current_branch}") != get_head_commit("origin/#{@@target_branch}")
|
83
|
-
# origin git@
|
84
|
-
# origin
|
83
|
+
# origin git@gitlab.qima-inc.com:guang-mobile-shop/AiGuangMaxApp.git (push)
|
84
|
+
# origin https://gitlab.qima-inc.com/guang-mobile-shop/AiGuangMaxApp.git (push)
|
85
85
|
result = `git remote -v | grep push`
|
86
86
|
project_name = result.split('.com/')[1]
|
87
87
|
if project_name == nil || project_name.strip == ''
|
@@ -90,14 +90,13 @@ module DNGG
|
|
90
90
|
|
91
91
|
if project_name != nil
|
92
92
|
project_name = project_name.split('.git')[0].gsub('/', '%2F')
|
93
|
-
|
94
93
|
begin
|
95
94
|
params = {}
|
96
95
|
params['source_branch'] = @@current_branch
|
97
96
|
params['target_branch'] = @@target_branch
|
98
97
|
params['title'] = @@msg
|
99
98
|
# params['remove_source_branch'] = true
|
100
|
-
uri = URI.parse("https://
|
99
|
+
uri = URI.parse("https://gitlab.qima-inc.com/api/v4/projects/#{project_name}/merge_requests?private_token=#{@@token}")
|
101
100
|
response = Net::HTTP.post_form(uri, params)
|
102
101
|
result = Oj.load(response.body)
|
103
102
|
|
@@ -121,6 +120,8 @@ module DNGG
|
|
121
120
|
@@token = init_check_token
|
122
121
|
create_mr(sub)
|
123
122
|
return
|
123
|
+
when Net::HTTPForbidden then
|
124
|
+
puts response.body.red
|
124
125
|
end
|
125
126
|
rescue => e
|
126
127
|
puts "error: #{e}".red
|
data/lib/dngg/mr/email.rb
CHANGED
@@ -4,18 +4,21 @@ require 'net/smtp'
|
|
4
4
|
module DNGG
|
5
5
|
module Email
|
6
6
|
def send_email(user,title,msg)
|
7
|
+
user_mail = `git config user.email`
|
7
8
|
message = <<END_OF_MESSAGE
|
8
|
-
DNGG Merge Request <
|
9
|
+
DNGG Merge Request <team_android@aiguang.com>
|
10
|
+
From: #{user}
|
9
11
|
To: Guang Android Team
|
10
12
|
Subject: [#{user}] #{title}
|
11
13
|
|
12
14
|
#{msg}
|
15
|
+
|
13
16
|
END_OF_MESSAGE
|
14
17
|
|
15
|
-
Net::SMTP.start('smtp.exmail.qq.com',
|
16
|
-
|
17
|
-
smtp.send_message message,
|
18
|
-
|
18
|
+
Net::SMTP.start('smtp.exmail.qq.com',25,'zhuruixue',
|
19
|
+
'zhuruixue@aiguang.com','wwL9RS9cLeBxv7co', :plain) do |smtp|
|
20
|
+
smtp.send_message message, 'zhuruixue@aiguang.com',
|
21
|
+
'team_android@aiguang.com'
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
data/lib/dngg/version.rb
CHANGED
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: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iSnow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|