ocean_package 0.9.0 → 0.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a4bc23aa666b52c1c5721d116d66b4b5d8e45e271546c4a1b40c9f293d86048
4
- data.tar.gz: bb5a19d0acc1d8c61bf213d39942733ed53d3b3680d124c8c92bfee1a5fa5c38
3
+ metadata.gz: b1cc955eed6aa74ce48c6a3cc59c5bda438162073b8e86f04ec75261badf3e10
4
+ data.tar.gz: 5bfbf7f168a9436e6c07245c9ec2455ab66e3e4b5df4e517d52202a599afb778
5
5
  SHA512:
6
- metadata.gz: d9322243e7b67e171b0d65f8b4b6ccdb7fb0ee4e3f977eae87941a7749934b1280e64fe222449bde23c1e756f14bace4314ee11775de285992f8079156fb5859
7
- data.tar.gz: cd19248c665e3b5856870aa583bc6f28fb0b034d5e8b4b6324073923501df3b5d3fcaf4dff318a64c9cbbdcda69179dbe418ea35b10a9069076d52cbb1548665
6
+ metadata.gz: 10f73f3b8c22d9551656918c397475cc82ddc2bedaac49bb6b57164b38033166a65d4e81cb7815ab589ecb3b2a38ca1fe52d84da41084cd66b7364a1f420fa74
7
+ data.tar.gz: c6af45c8b814831a267e29a43c6f89ba328b6bc7d0784a11e676328bc74c631152cea7b693438bf4124e06514eafae39761b362e758a019f8d545ffc3b321aa4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ocean_package (0.8.0)
4
+ ocean_package (0.9.0)
5
5
  CFPropertyList
6
6
  dingbot
7
7
  faraday
data/README.md CHANGED
@@ -33,6 +33,7 @@ or
33
33
  ```
34
34
  sudo gem install dingbot
35
35
  sudo gem install semantic_logger
36
+ sudo gem install multipart-post
36
37
  ```
37
38
 
38
39
 
@@ -22,6 +22,9 @@ module OceanPackage
22
22
  # @ 的手机号
23
23
  attr_accessor :at_mobiles
24
24
 
25
+ # 自定义的ipa文件路径
26
+ attr_accessor :custom_ipa_file_path
27
+
25
28
  def initialize(params = [])
26
29
  argv = CLAide::ARGV.new(params)
27
30
 
@@ -46,7 +49,15 @@ module OceanPackage
46
49
  export_options_plist = argv.option("export-options-plist", "")
47
50
  Log.info("export_options_plist: #{export_options_plist}")
48
51
 
49
- @package = OceanPackage::Package.new(workspace_path, scheme, configuration, archive_path, company_name, export_options_plist)
52
+ ##### 自定义的 ipa 文件 #####
53
+ ipa_file_path = argv.option("ipa-file-path", "")
54
+ Log.info("ipa_file_path: #{ipa_file_path}")
55
+ @custom_ipa_file_path = ipa_file_path
56
+
57
+ # 自定义ipa文件,使用该文件作为 archive path
58
+ tmp_archive_path = has_custom_ipa_file ? File.dirname("#{ipa_file_path}") : archive_path
59
+ Log.info("tmp_archive_path: #{tmp_archive_path}")
60
+ @package = OceanPackage::Package.new(workspace_path, scheme, configuration, tmp_archive_path, company_name, export_options_plist)
50
61
 
51
62
  fir_token = argv.option("fir-token", "")
52
63
  Log.info("fir_token: #{fir_token}")
@@ -56,11 +67,11 @@ module OceanPackage
56
67
  Log.info("change_log: #{change_log}")
57
68
 
58
69
  fir_log_path = @package.final_archive_path + 'fir.log'
59
- @fir = OceanPackage::Fir.new(fir_token, final_change_log, @package.ipa_file_path, fir_log_path)
70
+ @fir = OceanPackage::Fir.new(fir_token, final_change_log, final_ipa_file_path, fir_log_path)
60
71
 
61
72
  ##### 蒲公英 #####
62
73
  pgy_api_key = argv.option("pgy-api-key", "")
63
- @pgy = OceanPackage::Pgy.new(pgy_api_key, final_change_log, @package.ipa_file_path)
74
+ @pgy = OceanPackage::Pgy.new(pgy_api_key, final_change_log, final_ipa_file_path)
64
75
  Log.info("pgy_api_key: #{pgy_api_key}")
65
76
 
66
77
  ##### oss #####
@@ -94,8 +105,22 @@ module OceanPackage
94
105
  end
95
106
  end
96
107
 
108
+ # 是否设置了自定义的ipa文件
109
+ def has_custom_ipa_file
110
+ "#{@custom_ipa_file_path}".empty? ? false : true
111
+ end
112
+
113
+ # 最终的ipa文件路径
114
+ def final_ipa_file_path
115
+ has_custom_ipa_file ? "#{@custom_ipa_file_path}" : @package.ipa_file_path
116
+ end
117
+
118
+ # 运行
97
119
  def run
98
- package.run
120
+ # 没有自定义ipa文件,需要执行打包命令
121
+ unless has_custom_ipa_file
122
+ package.run
123
+ end
99
124
  upload
100
125
  send_ding_talk_msg
101
126
  finished
@@ -157,7 +182,7 @@ module OceanPackage
157
182
 
158
183
  # web hook 消息内容
159
184
  def make_web_hook_message
160
- ipa = OceanPackage::Ipa.new(package.ipa_file_path)
185
+ ipa = OceanPackage::Ipa.new(final_ipa_file_path)
161
186
  ipa.run
162
187
 
163
188
  # markdown 格式
@@ -33,6 +33,9 @@ module OceanPackage
33
33
  @company_name = company_name
34
34
  @date_time = Time.new.strftime("%Y-%m-%d_%H-%M-%S")
35
35
  @export_options_plist = export_options_plist
36
+
37
+ # 预设置开始时间
38
+ @start_time = Time.now
36
39
  end
37
40
 
38
41
  # workspace 的路径
@@ -145,12 +148,19 @@ module OceanPackage
145
148
  # 最终的打包路径
146
149
  def final_archive_path
147
150
  path = processed_archive_path
148
- path += @company_name + '/'
149
- path += project_name + '/'
151
+ unless "#{@company_name}".empty?
152
+ path += @company_name + '/'
153
+ end
154
+ unless "#{project_name}".empty?
155
+ path += project_name + '/'
156
+ end
150
157
  path += @date_time + '/'
151
158
 
152
159
  Log.info("final archive path: #{path}")
153
160
 
161
+ # 不存在,需要进行创建,外部传入了 ipa 文件的情况
162
+ FileUtils.mkdir_p(path)
163
+
154
164
  path
155
165
  end
156
166
 
@@ -1,3 +1,3 @@
1
1
  module OceanPackage
2
- VERSION = "0.9.0"
2
+ VERSION = "0.10.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.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ocean