ocean_package 0.16.0 → 0.17.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: 4beb89548c285e64c27224159246f8f87dece0f84dc2a52e7ea480463139bb28
4
- data.tar.gz: b0e5607a4047d0d5c04e35c5f85dcc1dbe98101e985beec5795c6a0cc4a89ad5
3
+ metadata.gz: 637039069377b11f47969195b4475e5a43cc6b1be2ffacc14ecf6560df2f1605
4
+ data.tar.gz: d67605f811908a1e9a618a6a24b41eef85e6b9e9f00ae00b6b47a7dd5d2e317e
5
5
  SHA512:
6
- metadata.gz: 7901ef3622a6cb7c823565a50cb1abecd8785076c8873effb38493d13098f00c9c06e0bef0a60a46748aee27cf349143afbcbd5e1394f4d6e66d8d43a56ea43d
7
- data.tar.gz: d5c2c4d52d7fed9e533af60a72fd7dd4bfd253f298b3da718259a23038c8dacdc2a1b9df4f275769079a1e284239343cdde6c409e470465329cc71e358a31058
6
+ metadata.gz: 862d453052e203c6e0ed8d059b14cc43c56ad61fac6be162baac34d53f587e0aff04b08d4e206ed1bca30d7f000751abe0b1f9eeb8e35ec707d29ded1a9c7f5c
7
+ data.tar.gz: b0786cf6887ed1b7750c0d7af7958e820d976f36df93a37da66284eff52e3118fb80e9a5753b8d11462995addf5cc48fecb74442fb510dbe9b0c4d1135d05dbd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ocean_package (0.14.0)
4
+ ocean_package (0.17.0)
5
5
  CFPropertyList
6
6
  dingbot
7
7
  faraday
@@ -2,6 +2,7 @@
2
2
  module OceanPackage
3
3
  class Command
4
4
  include OceanPackage::TimeFlow::Mixin
5
+ require 'net/http'
5
6
 
6
7
  # xcodebuild 打包相关
7
8
  attr_accessor :package
@@ -26,6 +27,11 @@ module OceanPackage
26
27
  # 自定义的ipa文件路径
27
28
  attr_accessor :custom_ipa_file_path
28
29
 
30
+ # 整个流程时间记录上报url
31
+ attr_accessor :time_flow_url
32
+
33
+ # 整个流程时间记录上报url,额外的参数
34
+ attr_accessor :time_flow_extra_req
29
35
 
30
36
  def initialize(params = [])
31
37
  argv = CLAide::ARGV.new(params)
@@ -63,6 +69,14 @@ module OceanPackage
63
69
  open_finder = argv.flag?("open-finder", false )
64
70
  Log.info("open-finder: #{open_finder}")
65
71
 
72
+ time_flow_url = argv.option("time-flow-url", "")
73
+ Log.info("time_flow_url: #{time_flow_url}")
74
+ @time_flow_url = time_flow_url
75
+
76
+ time_flow_extra_req = argv.option("time-flow-extra-req", "")
77
+ Log.info("time_flow_extra_req: #{time_flow_extra_req}")
78
+ @time_flow_extra_req = time_flow_extra_req
79
+
66
80
  # 自定义ipa文件,使用该文件作为 archive path
67
81
  tmp_archive_path = has_custom_ipa_file ? File.dirname("#{ipa_file_path}") : archive_path
68
82
  Log.info("tmp_archive_path: #{tmp_archive_path}")
@@ -253,7 +267,6 @@ module OceanPackage
253
267
  time_flow_dir = @package.final_archive_path
254
268
  time_flow_file_path = "#{time_flow_dir}timeflow.json"
255
269
  params = time_flow.make_all_points
256
- params['timeFlowPath'] = time_flow_file_path
257
270
  json = JSON.dump(params)
258
271
 
259
272
  unless File.exist?(time_flow_file_path)
@@ -266,6 +279,35 @@ module OceanPackage
266
279
  else
267
280
  Log.error("write time flow to path(fail): #{time_flow_file_path}")
268
281
  end
282
+
283
+ upload_time_flow_data(params)
284
+ end
285
+
286
+ def upload_time_flow_data(data)
287
+ time_flow_url_value = "#{@time_flow_url}"
288
+ unless time_flow_url_value.empty?
289
+ Log.info("upload time flow data")
290
+
291
+ uri = URI.parse(time_flow_url_value)
292
+ params = data
293
+
294
+ # 分割
295
+ extra_params = "#{@time_flow_extra_req}".split(",")
296
+ # 再拼接
297
+ extra_params.each do |p|
298
+ extra_key_values = "#{p}".split("=")
299
+ if extra_key_values.length == 2
300
+ extra_key = "#{extra_key_values[0]}"
301
+ extra_value = "#{extra_key_values[1]}"
302
+ if extra_key.length > 0 && extra_value.length > 0
303
+ params[extra_key] = extra_value
304
+ end
305
+ end
306
+ end
307
+
308
+ res = Net::HTTP.post_form(uri, params)
309
+ Log.info("upload time flow data result: #{res.body}")
310
+ end
269
311
  end
270
312
 
271
313
  end
@@ -1,3 +1,3 @@
1
1
  module OceanPackage
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean_package
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ocean