gct 0.4.5 → 0.5.2
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/lib/gct/command/autotag.rb +4 -1
- data/lib/gct/command/init/gitlab-ci.rb +0 -2
- data/lib/gct/command/robot.rb +1 -0
- data/lib/gct/command/robot/summary.rb +34 -0
- data/lib/gct/command/update/podfile.rb +1 -0
- data/lib/gct/command/update/tag.rb +24 -9
- data/lib/gct/gct_version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 488e91b7f75828fcc37243173f3ddc60840055aca8ebaae02dfcb481e2e3cd2b
|
4
|
+
data.tar.gz: 4ecd7fe5bce7c4106dff22ca33a7f739bf94f5b8fb793215c59b146e3411a6d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ea825c59c3a47d1fa0b4f1e4e46295fd8089b4e602070fb15db6125704268241b2bcd56291170140d4ed26b648fa74479c116a29a40ab1585755df36018a23b
|
7
|
+
data.tar.gz: fb94c302f1147c6ea23620c2a5ea816dfe8df1a169faf0edf5394792d612f9c223a316462a2614bc66b2182087298f03924bb3d43f5e8e89030e88a4d9950465
|
data/lib/gct/command/autotag.rb
CHANGED
@@ -249,7 +249,7 @@ module Gct
|
|
249
249
|
db = Database::Data.new
|
250
250
|
# 查询优先级最高的为完成打tag的数据
|
251
251
|
where_statement = "and is_pre = " + (@pre ? "1" : "0")
|
252
|
-
sql = "select * from tag where priority = (select MAX(priority) from tag
|
252
|
+
sql = "select * from tag where priority = (select MAX(priority) from tag) and project_version = '#{@version}' and tag_status != '#{SpecPublishStatus::SUCCESS}' #{where_statement}"
|
253
253
|
result = db.query(sql)
|
254
254
|
vals = ""
|
255
255
|
ins = ""
|
@@ -258,8 +258,11 @@ module Gct
|
|
258
258
|
if row["tag_status"].eql?(SpecPublishStatus::WAITING) || row["tag_status"].eql?(SpecPublishStatus::CANCELED) || row["tag_status"].eql?(SpecPublishStatus::FAILED)
|
259
259
|
status = SpecPublishStatus::PENDING
|
260
260
|
name = row["pod_name"]
|
261
|
+
puts "pod name is " + name
|
261
262
|
vals.concat("when pod_name = '#{name}' then '#{status}' ")
|
263
|
+
puts vals
|
262
264
|
ins.concat("'#{name}',")
|
265
|
+
puts ins
|
263
266
|
system "gct update dependency #{name} tag_status #{status}"
|
264
267
|
skip_tag = ""
|
265
268
|
if row["is_tag"].to_i == 1
|
@@ -5,13 +5,11 @@ stages:
|
|
5
5
|
push_pod:
|
6
6
|
stage: push
|
7
7
|
script:
|
8
|
-
- gct robot start
|
9
8
|
- echo "开始lint 和 push podspec"
|
10
9
|
- gct update dependency $CI_PROJECT_NAME "tag_status" "deploying"
|
11
10
|
- gct clean lint $CI_PROJECT_NAME
|
12
11
|
- gct repo update
|
13
12
|
- gct repo push
|
14
|
-
- gct robot finish true
|
15
13
|
- gct update dependency $CI_PROJECT_NAME "tag_version" $CI_COMMIT_REF_NAME
|
16
14
|
- gct update next
|
17
15
|
only:
|
data/lib/gct/command/robot.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Gct
|
5
|
+
class Command
|
6
|
+
class Robot < Command
|
7
|
+
class Summary < Robot
|
8
|
+
|
9
|
+
self.summary = '汇总'
|
10
|
+
self.description = <<-DESC
|
11
|
+
汇总
|
12
|
+
DESC
|
13
|
+
|
14
|
+
self.arguments = [
|
15
|
+
]
|
16
|
+
|
17
|
+
def self.options
|
18
|
+
[
|
19
|
+
['--test', '测试机器人,测试webhook'],
|
20
|
+
].concat(super)
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(argv)
|
24
|
+
@test = argv.flag?('test', false)
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -51,11 +51,9 @@ module Gct
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def skip_tag_method
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
accept_merge_request
|
58
|
-
end
|
54
|
+
isEmptyMR = mr_to_master
|
55
|
+
if !isEmptyMR
|
56
|
+
accept_merge_request
|
59
57
|
end
|
60
58
|
remove_and_create_tag
|
61
59
|
end
|
@@ -93,15 +91,32 @@ module Gct
|
|
93
91
|
end
|
94
92
|
|
95
93
|
def update_ci_method
|
96
|
-
puts "
|
94
|
+
puts "正在检查CI文件".green
|
97
95
|
temp_local_file = TempLocalFile.new()
|
98
96
|
path = File.expand_path("../../init", __FILE__)
|
99
97
|
ci_content = temp_local_file.read_path_file(path, "gitlab-ci.rb")
|
100
98
|
if check_ci
|
101
|
-
|
99
|
+
# 检查 ci 文件是否有变化
|
100
|
+
remote_content = file_contents("#{Constant.NameSpace}#{@name}", '.gitlab-ci.yml', @update_version_branch)
|
101
|
+
remote_content.force_encoding('UTF-8')
|
102
|
+
strip_remote_content = remote_content.gsub(/\s/,'')
|
103
|
+
ci_content.force_encoding('UTF-8')
|
104
|
+
strip_ci_content = ci_content.gsub(/\s/,'')
|
105
|
+
|
106
|
+
if strip_ci_content.eql?strip_remote_content
|
107
|
+
puts "无需更新CI文件".green
|
108
|
+
else
|
109
|
+
edit_file('.gitlab-ci.yml', ci_content, 'update ci')
|
110
|
+
mr_to_master_if_need
|
111
|
+
end
|
102
112
|
else
|
103
113
|
create_file('.gitlab-ci.yml', ci_content, 'init ci')
|
114
|
+
mr_to_master_if_need
|
104
115
|
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
def mr_to_master_if_need
|
105
120
|
isEmptyMR = mr_to_master
|
106
121
|
if !isEmptyMR
|
107
122
|
accept_merge_request
|
@@ -141,7 +156,7 @@ module Gct
|
|
141
156
|
end
|
142
157
|
replace_string = version_match.gsub(tag_regex, @new_tag)
|
143
158
|
updated_podspec_content = podspec_content.gsub(version_match, replace_string)
|
144
|
-
puts "
|
159
|
+
puts "#{@name} 更新版本号为:#{@new_tag}".green
|
145
160
|
edit_file(@file, updated_podspec_content, "@config 更新版本号:#{@new_tag}")
|
146
161
|
mr_to_master
|
147
162
|
accept_merge_request
|
@@ -196,7 +211,7 @@ module Gct
|
|
196
211
|
db = Database::Data.new
|
197
212
|
sql = "update tag t left join project p on t.project_version = p.version set t.is_tag = 1 where t.pod_name = '#{@name}' and t.is_tag != 1 and p.is_done = 0"
|
198
213
|
db.query(sql)
|
199
|
-
puts "
|
214
|
+
puts "开始上传podspec... 请在CI中查看结果".green
|
200
215
|
end
|
201
216
|
end
|
202
217
|
end
|
data/lib/gct/gct_version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jieming
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/gct/command/robot/finish.rb
|
193
193
|
- lib/gct/command/robot/podfile.rb
|
194
194
|
- lib/gct/command/robot/start.rb
|
195
|
+
- lib/gct/command/robot/summary.rb
|
195
196
|
- lib/gct/command/setup.rb
|
196
197
|
- lib/gct/command/spec.rb
|
197
198
|
- lib/gct/command/spec/lint.rb
|