fir-cli 1.6.6 → 1.6.7.alpha

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
  SHA1:
3
- metadata.gz: 7220dc42dd55229fc0ef694f0ca08c7e38caab37
4
- data.tar.gz: dab71b82677c1b051787545af88ae18c6eef4278
3
+ metadata.gz: 78a3f802006cf3e7ccf72d080a108aa17a524a4c
4
+ data.tar.gz: a5d40dbd014932de0c4a9a37f301fc51579ffdc9
5
5
  SHA512:
6
- metadata.gz: cde221ffcf1ae609ad181e3d9240546c8e7e1bc14b39a95e710a6d40d9eaa851235caece707f243b9aa4fd7855b754a4f9f99459fdbdeedbfa4587ccbed4855e
7
- data.tar.gz: ca40d85cf3389e9bfa488508f4be3a094c6b9c2d60ee6b658dc240399aa40d6aa8d6df4d058e67ca1884d0d0ed2cac60d450e84a6c90f3fa9270f09d3195eb54
6
+ metadata.gz: 7ae80450e1bd35fa41ce788cc6273c26d2e7780eb3effe15d2e9ef16ea27371063290436e68dbb628f212e78ba4b3178df4fad89a53b28ec1dbc84d7f7003c3a
7
+ data.tar.gz: ed977bcd3b135e730a43c0328a31eeb3c2ad180f47c9a976f707d9c977047e5d6713df405b8c8900870807be15d7e6695eded300cd2637022e8d78c00256f61e
data/.travis.yml CHANGED
@@ -1,20 +1,13 @@
1
1
  rvm:
2
- - 1.9.2
3
- - 1.9.3
4
- - 2.0.0
5
2
  - 2.1
6
3
  - 2.2
7
4
  - 2.3
5
+ - 2.4
6
+ - 2.4
8
7
  - ruby-head
9
- - rbx-2
10
- - jruby
11
- - jruby-head
12
8
  matrix:
13
9
  allow_failures:
14
10
  - rvm: ruby-head
15
- - rvm: jruby
16
- - rvm: jruby-head
17
- - rvm: rbx-2
18
11
  env:
19
12
  matrix:
20
13
  - USE_OFFICIAL_GEM_SOURCE=true
@@ -22,7 +15,7 @@ env:
22
15
  secure: XiWKHPcQNB/mGv8Q5VuBqETS1bmYZ3t5xJkR/JFHrhWi30O+QWulMM5YjzkVawPjpUS/rtefDEASc4bN+a1iRVi6kf8fxjeKNFAzNc/hEKiPgANELf1JJgGAcz4oygzrH94Vqj90fuf6DoUh9r+IO+Z0PF39GL9GCnUjJeg+zao=
23
16
  notifications:
24
17
  recipients:
25
- - hxy@fir.im
18
+ - jc@fir.im
26
19
  branches:
27
20
  only:
28
21
  - master
data/Gemfile CHANGED
@@ -8,5 +8,5 @@ end
8
8
  # gem 'byebug'
9
9
  # Specify your gem's dependencies in fir.gemspec
10
10
  gemspec
11
-
11
+ gem 'byebug'
12
12
  gem 'codeclimate-test-reporter', group: :test, require: nil
data/lib/fir/api.yml CHANGED
@@ -4,8 +4,4 @@ fir:
4
4
  user_url: 'http://api.fir.im/user'
5
5
  app_url: 'http://api.fir.im/apps'
6
6
  udids_url: 'http://api.fir.im/devices/multi_udid'
7
- bughd:
8
- domain: 'http://bughd.com'
9
- base_url: 'http://api.bughd.com'
10
- project_url: 'http://api.bughd.com/projects'
11
- full_version_url: 'http://api.bughd.com/full_versions'
7
+
@@ -1,15 +1,15 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module FIR
4
4
  module Publish
5
-
6
5
  def publish(*args, options)
7
6
  initialize_publish_options(args, options)
8
7
  check_supported_file_and_token
9
8
 
10
9
  logger_info_publishing_message
11
10
 
12
- @app_info = send("#{@file_type}_info", @file_path, full_info: true)
11
+ @app_info = send("#{@file_type}_info", @file_path, full_info: true)
12
+ @user_info = fetch_user_info(@token)
13
13
  @uploading_info = fetch_uploading_info
14
14
  @app_id = @uploading_info[:id]
15
15
 
@@ -20,9 +20,7 @@ module FIR
20
20
 
21
21
  upload_mapping_file_with_publish(options)
22
22
  if options[:show_release_id]
23
- sleep 2
24
- release_info = fetch_release_id
25
- logger.info "release id = #{release_info[:id]}"
23
+ logger.info "release id = #{answer[:release_id]}"
26
24
  end
27
25
  logger_info_blank_line
28
26
  end
@@ -42,18 +40,17 @@ module FIR
42
40
  @binary_cert = @uploading_info[:cert][:binary]
43
41
 
44
42
  upload_app_icon unless @app_info[:icons].blank?
45
- upload_app_binary
43
+ answer = upload_app_binary
46
44
  upload_device_info
47
45
  update_app_info
48
-
49
46
  fetch_app_info
50
-
51
-
52
47
  end
53
-
54
- %w(binary icon).each do |word|
48
+
49
+ %w[binary icon].each do |word|
55
50
  define_method("upload_app_#{word}") do
56
51
  upload_file(word)
52
+ storage = ENV['SOTRAGE_NAME'] || 'qiniu'
53
+ post("#{fir_api[:base_url]}/auth/#{storage}/callback", send("#{word}_information"))
57
54
  end
58
55
  end
59
56
 
@@ -62,29 +59,55 @@ module FIR
62
59
  url = @uploading_info[:cert][postfix.to_sym][:upload_url]
63
60
  info = send("uploading_#{postfix}_info")
64
61
  logger.debug "url = #{url}, info = #{info}"
65
- uploaded_info = post(url, info, {
66
- params_to_json: false,
67
- header: nil
68
- })
69
-
70
- return if uploaded_info[:is_completed]
71
-
72
-
62
+ uploaded_info = post(url, info.merge(manual_callback: true),
63
+ params_to_json: false,
64
+ header: nil)
65
+ rescue StandardError
73
66
  logger.error "Uploading app #{postfix} failed"
74
67
  exit 1
75
68
  end
76
69
 
77
70
  def uploading_icon_info
78
- large_icon_path = @app_info[:icons].max_by { |f| File.size(f) }
79
- uncrushed_icon_path = convert_icon(large_icon_path)
71
+ large_icon_path = @app_info[:icons].max_by { |f| File.size(f) }
72
+ @uncrushed_icon_path = convert_icon(large_icon_path)
80
73
  {
81
74
  key: @icon_cert[:key],
82
75
  token: @icon_cert[:token],
83
- file: File.new(uncrushed_icon_path, 'rb'),
76
+ file: File.new(@uncrushed_icon_path, 'rb'),
84
77
  'x:is_converted' => '1'
85
78
  }
86
79
  end
87
80
 
81
+ def icon_information
82
+ {
83
+ key: @icon_cert[:key],
84
+ token: @icon_cert[:token],
85
+ origin: 'fir-cli',
86
+ parent_id: @app_id,
87
+ fsize: File.size(@uncrushed_icon_path),
88
+ fname: 'blob'
89
+ }
90
+ end
91
+
92
+ def binary_information
93
+ {
94
+ build: @app_info[:build],
95
+ fname: File.basename(@file_path),
96
+ key: @binary_cert[:key],
97
+ name: @app_info[:display_name] || @app_info[:name],
98
+ origin: 'fir-cli',
99
+ parent_id: @app_id,
100
+ release_tag: 'develop',
101
+ fsize: File.size(@file_path),
102
+ release_type: @app_info[:release_type],
103
+ distribution_name: @app_info[:distribution_name],
104
+ token: @binary_cert[:token],
105
+ version: @app_info[:version],
106
+ changelog: @changelog,
107
+ user_id: @user_info[:id]
108
+ }.reject { |x| x.nil? || x == '' }
109
+ end
110
+
88
111
  def uploading_binary_info
89
112
  {
90
113
  key: @binary_cert[:key],
@@ -108,14 +131,14 @@ module FIR
108
131
  post fir_api[:udids_url], key: @binary_cert[:key],
109
132
  udids: @app_info[:devices].join(','),
110
133
  api_token: @token
111
- end
134
+ end
112
135
 
113
136
  def update_app_info
114
137
  update_info = { short: @short, passwd: @passwd, is_opened: @is_opened }.compact
115
138
 
116
139
  return if update_info.blank?
117
140
 
118
- logger.info "Updating app info......"
141
+ logger.info 'Updating app info......'
119
142
 
120
143
  patch fir_api[:app_url] + "/#{@app_id}", update_info.merge(api_token: @token)
121
144
  end
@@ -190,7 +213,7 @@ module FIR
190
213
  fetch_user_info(@token)
191
214
  end
192
215
 
193
- def convert_icon origin_path
216
+ def convert_icon(origin_path)
194
217
  logger.info "Converting app's icon......"
195
218
 
196
219
  if @app_info[:type] == 'ios'
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '1.6.6'
4
+ VERSION = '1.6.7.alpha'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-29 00:00:00.000000000 Z
12
+ date: 2018-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -262,9 +262,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  requirements:
265
- - - ">="
265
+ - - ">"
266
266
  - !ruby/object:Gem::Version
267
- version: '0'
267
+ version: 1.3.1
268
268
  requirements: []
269
269
  rubyforge_project:
270
270
  rubygems_version: 2.6.14