gct 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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 +21 -4
- 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: a862c669dd00f8f75eac90ea9438a8774dd6c5fb190de25cc34024c028bbf6c3
|
4
|
+
data.tar.gz: da2c3466907b592e4bc02775b5b07ca2e69b64ad0122031b99fa00d49c212ae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c00440bc3426b6a629353a850bd652cb7a2d4d61efcbe4c1e81f45903606aa50c3c3bc5ea8983fff825a78de7c7d2a0231277aeedd85d526ce0ff7a63846f4c
|
7
|
+
data.tar.gz: c35c3dee9f8c30d38a334937eebc6203effa5cf38d6ff675e2876e04bd491fc64f4df3f38e1e0808b2d8707bc7cfd473696a7c5bfc8d974a0b333824a6422f36
|
@@ -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
|
@@ -93,15 +93,32 @@ module Gct
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def update_ci_method
|
96
|
-
puts "
|
96
|
+
puts "正在检查CI文件".green
|
97
97
|
temp_local_file = TempLocalFile.new()
|
98
98
|
path = File.expand_path("../../init", __FILE__)
|
99
99
|
ci_content = temp_local_file.read_path_file(path, "gitlab-ci.rb")
|
100
100
|
if check_ci
|
101
|
-
|
101
|
+
# 检查 ci 文件是否有变化
|
102
|
+
remote_content = file_contents("#{Constant.NameSpace}#{@name}", '.gitlab-ci.yml', @update_version_branch)
|
103
|
+
remote_content.force_encoding('UTF-8')
|
104
|
+
strip_remote_content = remote_content.gsub(/\s/,'')
|
105
|
+
ci_content.force_encoding('UTF-8')
|
106
|
+
strip_ci_content = ci_content.gsub(/\s/,'')
|
107
|
+
|
108
|
+
if strip_ci_content.eql?strip_remote_content
|
109
|
+
puts "无需更新CI文件".green
|
110
|
+
else
|
111
|
+
edit_file('.gitlab-ci.yml', ci_content, 'update ci')
|
112
|
+
mr_to_master_if_need
|
113
|
+
end
|
102
114
|
else
|
103
115
|
create_file('.gitlab-ci.yml', ci_content, 'init ci')
|
116
|
+
mr_to_master_if_need
|
104
117
|
end
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
def mr_to_master_if_need
|
105
122
|
isEmptyMR = mr_to_master
|
106
123
|
if !isEmptyMR
|
107
124
|
accept_merge_request
|
@@ -141,7 +158,7 @@ module Gct
|
|
141
158
|
end
|
142
159
|
replace_string = version_match.gsub(tag_regex, @new_tag)
|
143
160
|
updated_podspec_content = podspec_content.gsub(version_match, replace_string)
|
144
|
-
puts "
|
161
|
+
puts "#{@name} 更新版本号为:#{@new_tag}".green
|
145
162
|
edit_file(@file, updated_podspec_content, "@config 更新版本号:#{@new_tag}")
|
146
163
|
mr_to_master
|
147
164
|
accept_merge_request
|
@@ -196,7 +213,7 @@ module Gct
|
|
196
213
|
db = Database::Data.new
|
197
214
|
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
215
|
db.query(sql)
|
199
|
-
puts "
|
216
|
+
puts "开始上传podspec... 请在CI中查看结果".green
|
200
217
|
end
|
201
218
|
end
|
202
219
|
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.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jieming
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-21 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
|