gct 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2543169b03dd0c5d196ea4af9fb3214efccfd54165fb5418c3fb36e9f04c0b88
4
- data.tar.gz: a17f7e2f676904a9c8c6b0acd7ffc08fe0d8db6f07f974f8825e90a120ffa2cb
3
+ metadata.gz: aa8c2d1eee0e3de12793d740b4b85285d7ef4aa94748b6c8f8dad352a17b2d06
4
+ data.tar.gz: e0f6650f0f55f6e065b625f692f6409df5ed1d7fdd65f9fa056b36f191bbf344
5
5
  SHA512:
6
- metadata.gz: 8c620629c7a89a8758a44c45635ed470cc42330f954c05a2bb7caf0adf2892215f7b40833f702a1378e18e648ec7ce383e5f81520622a5bd4677899ea74c7687
7
- data.tar.gz: c1ad60709ac0c069086abccd377cf30a106f34f93ca224ca6541a0bcbf6010f521503beff69ee035648d1b74de8f73b751c7e819b638ea84928182d46970faff
6
+ metadata.gz: 82c58652b0e9ac64ebd3872637827a80e15dcc7b037d746e896dc6b955e3b3e26521c2035aaf0b6ea9f5bbc61fe242221ad637f3bb55961965f4a0a6b6de1b8c
7
+ data.tar.gz: d90e059df0b133c6e42a6db11b8a960b9241b8821700ce1b69a331edad10b4bffbb898eadd15851163b8ad1b706e1f2112a442992f7ef0491a3b1b83ec20fd56
@@ -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 where project_version = '#{@version}' and tag_status != '#{SpecPublishStatus::SUCCESS}' #{where_statement})"
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 = ""
@@ -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:
@@ -24,9 +24,9 @@ module Gct
24
24
  end
25
25
 
26
26
  def pushRepo
27
- puts "pod 命令为:pod repo push iOSCRGTPodSource --sources=#{Constant.GitURL}iOSCRGTPodSource.git --verbose --skip-import-validation --use-libraries --allow-warnings".green
27
+ puts "pod 命令为:pod repo push iOSCRGTPodSource --sources=#{Constant.GitURL}iOSCRGTPodSource.git --verbose --skip-import-validation --use-libraries --allow-warnings --use-modular-headers".green
28
28
  # exception: ruby 2.6 以上生效
29
- system "pod repo push iOSCRGTPodSource --sources=#{Constant.GitURL}iOSCRGTPodSource.git --verbose --skip-import-validation --use-libraries --allow-warnings", exception: true
29
+ system "pod repo push iOSCRGTPodSource --sources=#{Constant.GitURL}iOSCRGTPodSource.git --verbose --skip-import-validation --use-libraries --allow-warnings --use-modular-headers", exception: true
30
30
  end
31
31
  end
32
32
  end
@@ -1,6 +1,7 @@
1
1
  require 'gct/command/robot/start'
2
2
  require 'gct/command/robot/finish'
3
3
  require 'gct/command/robot/podfile'
4
+ require 'gct/command/robot/summary'
4
5
  require 'net/https'
5
6
  require 'json'
6
7
 
@@ -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
@@ -72,6 +72,7 @@ module Gct
72
72
  u_db.query(u_sql)
73
73
 
74
74
  system "gct robot podfile"
75
+ system "gct robot summary"
75
76
  end
76
77
 
77
78
  def edit_file(content)
@@ -56,6 +56,10 @@ module Gct
56
56
  if !isEmptyMR
57
57
  accept_merge_request
58
58
  end
59
+
60
+ isEmptyMR = mr_to_master
61
+ if !isEmptyMR
62
+ accept_merge_request
59
63
  end
60
64
  remove_and_create_tag
61
65
  end
@@ -93,14 +97,34 @@ module Gct
93
97
  end
94
98
 
95
99
  def update_ci_method
96
- puts "更新ci文件".green
100
+ puts "正在检查CI文件".green
97
101
  temp_local_file = TempLocalFile.new()
98
102
  path = File.expand_path("../../init", __FILE__)
99
103
  ci_content = temp_local_file.read_path_file(path, "gitlab-ci.rb")
100
104
  if check_ci
101
- edit_file('.gitlab-ci.yml', ci_content, 'update ci')
105
+ # 检查 ci 文件是否有变化
106
+ remote_content = file_contents("#{Constant.NameSpace}#{@name}", '.gitlab-ci.yml', @update_version_branch)
107
+ remote_content.force_encoding('UTF-8')
108
+ strip_remote_content = remote_content.gsub(/\s/,'')
109
+ ci_content.force_encoding('UTF-8')
110
+ strip_ci_content = ci_content.gsub(/\s/,'')
111
+
112
+ if strip_ci_content.eql?strip_remote_content
113
+ puts "无需更新CI文件".green
114
+ else
115
+ edit_file('.gitlab-ci.yml', ci_content, 'update ci')
116
+ mr_to_master_if_need
117
+ end
102
118
  else
103
119
  create_file('.gitlab-ci.yml', ci_content, 'init ci')
120
+ mr_to_master_if_need
121
+ end
122
+ end
123
+
124
+ def mr_to_master_if_need
125
+ isEmptyMR = mr_to_master
126
+ if !isEmptyMR
127
+ accept_merge_request
104
128
  end
105
129
  end
106
130
 
@@ -137,7 +161,7 @@ module Gct
137
161
  end
138
162
  replace_string = version_match.gsub(tag_regex, @new_tag)
139
163
  updated_podspec_content = podspec_content.gsub(version_match, replace_string)
140
- puts "修改podpsec版本号成功!版本号为:#{@new_tag}".green
164
+ puts "#{@name} 更新版本号为:#{@new_tag}".green
141
165
  edit_file(@file, updated_podspec_content, "@config 更新版本号:#{@new_tag}")
142
166
  mr_to_master
143
167
  accept_merge_request
@@ -192,7 +216,7 @@ module Gct
192
216
  db = Database::Data.new
193
217
  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"
194
218
  db.query(sql)
195
- puts "打tag成功,开始上传podspec...".green
219
+ puts "开始上传podspec... 请在CI中查看结果".green
196
220
  end
197
221
  end
198
222
  end
@@ -2,5 +2,5 @@ module Gct
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.4.2".freeze unless defined? Gct::VERSION
5
+ VERSION = "0.5.0".freeze unless defined? Gct::VERSION
6
6
  end
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.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mysql2
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: claide
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -134,20 +148,6 @@ dependencies:
134
148
  - - ">="
135
149
  - !ruby/object:Gem::Version
136
150
  version: '0'
137
- - !ruby/object:Gem::Dependency
138
- name: mysql2
139
- requirement: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- version: '0'
144
- type: :runtime
145
- prerelease: false
146
- version_requirements: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- version: '0'
151
151
  description: '"gct ios 自动化脚本工具"'
152
152
  email:
153
153
  - 307113345@qq.com
@@ -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