deploygate 0.6.7 → 0.6.8

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: 683c37a3388ad0e42e4fdb860fe3cc7d705831fa912bee34f415fb5dbda634bc
4
- data.tar.gz: d8c5c1f552dc84cb7ade0c76cdcd20ff0b6f438048c1c714c5211f17e5336917
3
+ metadata.gz: 4bdbcc5de1df4f1c28a1872b64fdcfb8935069f7659553527d6c305d2a5f48fe
4
+ data.tar.gz: 176b482a0756f4f8bd80a5ecaf61ad400a936ecf537235849807719b0d0f4bd3
5
5
  SHA512:
6
- metadata.gz: a602970427fef7d236d40914d948f5aafc9a4404d52c514b0859c1aa4ad3647408814eaa8c80d215ed46cc07b57ef9f406be9f543b2a9615886bb09ed76ae101
7
- data.tar.gz: 7e1ac49b8bd8d8549a9ce45857ff9252b3249d2d367d0d1dad3e632ccebbde77b80857da76ddfdb333752cd8c7c72b73b09b0dab03511d454c182ad2e193dbe6
6
+ metadata.gz: dc4f630cdb9e9ca6b0838e4d94edd9ccfbaad2ae494e73ac89c1560ca7467873d2fd596e22499c5b6626c7160bf7eee3dca6e70968a0bc4a00534ae68afae681
7
+ data.tar.gz: e922a9fb18e69c3451d221bdc05acb1a9bf4021623103a97dbc35811b49950e12dfba20368f9dbb1565b690d0bddbaf3034ecb8b72dc009771a4ca595f5d6fd6
data/.travis.yml CHANGED
@@ -5,7 +5,7 @@ env:
5
5
  rvm:
6
6
  - 2.2.0
7
7
  before_install:
8
- - gem install bundler
8
+ - gem install bundler -v 1.17.3
9
9
  script:
10
10
  - bundle exec rake
11
11
  deploy:
@@ -6,7 +6,6 @@ en:
6
6
  login:
7
7
  description: 'Log in to DeployGate'
8
8
  terminal: 'Login in terminal'
9
- error: 'Commands::Login Error: %{e}'
10
9
  deploy:
11
10
  description: 'Build and upload a new build'
12
11
  message: 'Build description message'
@@ -16,14 +15,12 @@ en:
16
15
  scheme: 'Set Xcode build scheme (iOS app only)'
17
16
  open: 'Open a browser after the build uploaded (OS X only)'
18
17
  disable_notify: 'Disable email notification (iOS app only)'
19
- error: 'Commands::Deploy Error: %{e}'
20
18
  add_devices:
21
19
  description: 'Register devices to your Apple Developer account and refresh your provisioning profile. (iOS only) By default, it automatically finds new devices added to your application on DeployGate and ask you which device to register. You can also specify which device to register via command line options.'
22
20
  user: 'Owner user or organization name'
23
21
  udid: 'UDID to be registered'
24
22
  device_name: 'Device name to be registered'
25
23
  distribution_key: 'If you also want to update distribution page, set the last part of the URL of the page'
26
- error: 'Commands::AddDevices Error: %{e}'
27
24
  server:
28
25
  description: 'Start the add-devices server. When added new device automatically run add-devices command.'
29
26
  connecting: 'Connecting...'
@@ -32,17 +29,15 @@ en:
32
29
  finish_build: 'add-devices completed successfully.'
33
30
  logout:
34
31
  description: 'Log out current session'
35
- error: 'Commands::Logout Error: %{e}'
36
32
  config:
37
33
  description: "Configure login session of `dg` command. Usually, the session automatically created on the installation process so you don't need to use this command."
38
34
  json: 'Set output format to JSON'
39
35
  name: 'DeployGate user name'
40
36
  token: 'DeployGate API token'
41
- error: 'Commands::Config Error: %{e}'
42
37
  error_handling:
43
38
  message: 'Error: %{message}'
44
- agree: 'Do you want to report this issue on GitHub? (y/n) '
45
- please_open: 'Please open GitHub issue: %{url}'
39
+ agree: 'Do you want to this error report to DeployGate? (y/n) '
40
+ thanks: 'Thank you feedback! We will improve based on it.'
46
41
  show_update_message: |
47
42
  #################################################################
48
43
  # %{gem_name} %{latest_version} is available. You are on %{current_version}.
data/deploygate.gemspec CHANGED
@@ -24,8 +24,7 @@ POST_INSTALL_MESSAGE
24
24
  spec.add_runtime_dependency 'httpclient', '~> 2.8'
25
25
  spec.add_runtime_dependency 'commander', '~> 4.4'
26
26
  spec.add_runtime_dependency 'plist', '~> 3.1'
27
- spec.add_runtime_dependency 'xcodeproj', '~> 1.5.1'
28
- spec.add_runtime_dependency 'github_issue_request', '~> 0.1'
27
+ spec.add_runtime_dependency 'xcodeproj', '~> 1.7'
29
28
  spec.add_runtime_dependency 'highline', '~> 1.7'
30
29
  spec.add_runtime_dependency 'uuid', '~> 2.3'
31
30
  spec.add_runtime_dependency 'gem_update_checker', '~> 0.2'
@@ -36,11 +35,12 @@ POST_INSTALL_MESSAGE
36
35
  spec.add_runtime_dependency 'net-ping', '~> 2.0'
37
36
  spec.add_runtime_dependency 'socket.io-client-simple', '~> 1.2'
38
37
  spec.add_runtime_dependency 'workers', '~> 0.6'
38
+ spec.add_runtime_dependency 'sentry-raven', '~> 2.8'
39
39
 
40
40
  # ios build
41
41
  spec.add_runtime_dependency 'fastlane', '~> 2.57.2'
42
42
 
43
- spec.add_development_dependency 'bundler', '~> 1.13'
43
+ spec.add_development_dependency 'bundler', '~> 1.17'
44
44
  spec.add_development_dependency 'rake', '~> 12.0'
45
45
  spec.add_development_dependency 'rspec', '~> 3.5'
46
46
  spec.add_development_dependency 'webmock', '~> 2.3'
data/lib/deploygate.rb CHANGED
@@ -6,11 +6,11 @@ require "rbconfig"
6
6
  require "openssl"
7
7
  require "plist"
8
8
  require "find"
9
- require "github_issue_request"
10
9
  require "highline"
11
10
  require "uuid"
12
11
  require "gem_update_checker"
13
12
  require "active_support/core_ext/time"
13
+ require "active_support/core_ext/hash"
14
14
  require "locale"
15
15
  require "tempfile"
16
16
  require "open3"
@@ -21,6 +21,7 @@ require "webrick"
21
21
  require "net/ping"
22
22
  require "socket.io-client-simple"
23
23
  require "workers"
24
+ require "sentry-raven"
24
25
 
25
26
  require "i18n"
26
27
  I18n.load_path = Dir[File.join(File.dirname(__FILE__), '../config/locales/*.yml')]
@@ -34,7 +35,7 @@ require "xcodeproj"
34
35
  module DeployGate
35
36
  end
36
37
 
37
- require "deploygate/not_issue_error"
38
+ require "deploygate/raven_ignore_exception"
38
39
  require "deploygate/api/v1/base"
39
40
  require "deploygate/api/v1/session"
40
41
  require "deploygate/api/v1/push"
@@ -55,6 +56,7 @@ require "deploygate/config/cache_version"
55
56
  require "deploygate/session"
56
57
  require "deploygate/deploy"
57
58
  require "deploygate/project"
59
+ require "deploygate/raven_ignore_exception"
58
60
  require "deploygate/user"
59
61
  require "deploygate/browser_login"
60
62
  require "deploygate/add_devices_server"
@@ -3,7 +3,7 @@ module DeployGate
3
3
  include Commander::Methods
4
4
  attr_reader :arguments
5
5
 
6
- class NotInternetConnectionError < DeployGate::NotIssueError
6
+ class NotInternetConnectionError < DeployGate::RavenIgnoreException
7
7
  end
8
8
 
9
9
  PING_URL = 'https://deploygate.com'
@@ -15,6 +15,13 @@ module DeployGate
15
15
  CONFIG = 'config'
16
16
 
17
17
  def setup
18
+ # sentry config
19
+ Raven.configure do |config|
20
+ config.dsn = 'https://e0b4dda8fe2049a7b0d98c6d2759e067@sentry.io/1371610'
21
+ config.logger = Raven::Logger.new('/dev/null') # hide sentry log
22
+ config.excluded_exceptions = Raven::Configuration::IGNORE_DEFAULT + [DeployGate::RavenIgnoreException.name]
23
+ end
24
+
18
25
  # set Ctrl-C trap
19
26
  Signal.trap(:INT){
20
27
  puts ''
@@ -27,8 +34,6 @@ module DeployGate
27
34
  exit
28
35
  end
29
36
 
30
- # check update
31
- GithubIssueRequest::Url.config('deploygate', 'deploygate-cli')
32
37
  check_update()
33
38
  end
34
39
 
@@ -49,7 +54,7 @@ module DeployGate
49
54
  Commands::Login.run(args, options)
50
55
  rescue => e
51
56
  error_handling(LOGIN, e)
52
- raise e
57
+ exit 1
53
58
  end
54
59
  end
55
60
  end
@@ -70,7 +75,7 @@ module DeployGate
70
75
  Commands::Deploy.run(args, options)
71
76
  rescue => e
72
77
  error_handling(DEPLOY, e)
73
- raise e
78
+ exit 1
74
79
  end
75
80
  end
76
81
  end
@@ -91,7 +96,7 @@ module DeployGate
91
96
  Commands::AddDevices.run(args, options)
92
97
  rescue => e
93
98
  error_handling(ADD_DEVICES, e)
94
- raise e
99
+ exit 1
95
100
  end
96
101
  end
97
102
  end
@@ -104,7 +109,7 @@ module DeployGate
104
109
  Commands::Logout.run
105
110
  rescue => e
106
111
  error_handling(LOGOUT, e)
107
- raise e
112
+ exit 1
108
113
  end
109
114
  end
110
115
  end
@@ -120,7 +125,7 @@ module DeployGate
120
125
  Commands::Config.run(args, options)
121
126
  rescue => e
122
127
  error_handling(CONFIG, e)
123
- raise e
128
+ exit 1
124
129
  end
125
130
  end
126
131
  end
@@ -128,62 +133,54 @@ module DeployGate
128
133
  run!
129
134
  end
130
135
 
136
+ # @param [String] command
131
137
  # @param [Exception] error
132
- # @return [String]
133
- def create_error_issue_body(error)
134
- return <<EOF
135
-
136
- # Status
137
- deploygate-cli ver #{DeployGate::VERSION}
138
+ def error_handling(command, error)
139
+ STDERR.puts HighLine.color(I18n.t('command_builder.error_handling.message', message: error.message), HighLine::RED)
140
+ return if ENV['CI'] # When run ci server
141
+ return if error.kind_of?(DeployGate::RavenIgnoreException)
138
142
 
139
- # Error message
140
- #{error.message}
143
+ dg_version = DeployGate::VERSION
144
+ tags = {
145
+ command: command,
146
+ dg_version: dg_version
147
+ }
148
+ version = Gym::Xcode.xcode_version
149
+ tags[:xcode_version] = version if version.present?
141
150
 
142
- # Backtrace
143
- ```
144
- #{error.backtrace.join("\n")}
145
- ```
146
- EOF
151
+ puts ''
152
+ puts error_report(error, version, dg_version)
153
+ if HighLine.agree(I18n.t('command_builder.error_handling.agree')) {|q| q.default = "y"}
154
+ tags = {
155
+ command: command,
156
+ dg_version: DeployGate::VERSION
157
+ }
158
+ version = Gym::Xcode.xcode_version
159
+ tags[:xcode_version] = version if version.present?
160
+
161
+ Raven.capture_exception(error, tags: tags)
162
+ puts HighLine.color(I18n.t('command_builder.error_handling.thanks'), HighLine::GREEN)
163
+ end
147
164
  end
148
165
 
149
- # @param [Symbol] command
150
- # @param [Exception] error
151
- # @return [String]
152
- def create_issue_url(command, error)
153
- title = case command
154
- when LOGIN
155
- I18n.t('command_builder.login.error', e: error.class)
156
- when LOGOUT
157
- I18n.t('command_builder.logout.error', e: error.class)
158
- when DEPLOY
159
- I18n.t('command_builder.deploy.error', e: error.class)
160
- when ADD_DEVICES
161
- I18n.t('command_builder.add_devices.error', e: error.class)
162
- when CONFIG
163
- I18n.t('command_builder.config.error', e: error.class)
164
- end
165
-
166
- options = {
167
- :title => title,
168
- :body => create_error_issue_body(error),
169
- }
170
- GithubIssueRequest::Url.new(options).to_s
171
- end
166
+ def error_report(error, dg_version, xcode_version)
167
+ meta_info = "dg version: #{dg_version}"
168
+ meta_info += "\nXcode version: #{xcode_version}" if xcode_version.present?
172
169
 
173
- # @param [Symbol] command
174
- # @param [Exception] error
175
- def error_handling(command, error)
176
- STDERR.puts HighLine.color(I18n.t('command_builder.error_handling.message', message: error.message), HighLine::RED)
170
+ backtrace = error.backtrace.take(5).join("\n")
171
+ backtrace += "\nand more ..." if error.backtrace.count > 5
177
172
 
178
- return if ENV['CI'] # When run ci server
179
- return if error.kind_of?(DeployGate::NotIssueError)
180
- puts ''
181
- if HighLine.agree(I18n.t('command_builder.error_handling.agree')) {|q| q.default = "n"}
182
- url = create_issue_url(command, error)
183
- puts I18n.t('command_builder.error_handling.please_open', url: url)
184
- system('open', url) if Commands::Deploy::Push.openable?
185
- end
186
- puts ''
173
+ <<EOF
174
+ ------------------------
175
+ DeployGate Error Report
176
+
177
+ Title: #{error}
178
+ #{meta_info}
179
+
180
+ Stack trace:
181
+ #{backtrace}
182
+ ------------------------
183
+ EOF
187
184
  end
188
185
 
189
186
  # @return [void]
@@ -1,10 +1,10 @@
1
1
  module DeployGate
2
2
  class Deploy
3
- class NotLoginError < DeployGate::NotIssueError
3
+ class NotLoginError < DeployGate::RavenIgnoreException
4
4
  end
5
- class NotFileExistError < DeployGate::NotIssueError
5
+ class NotFileExistError < DeployGate::RavenIgnoreException
6
6
  end
7
- class UploadError < DeployGate::NotIssueError
7
+ class UploadError < DeployGate::RavenIgnoreException
8
8
  end
9
9
 
10
10
  class << self
@@ -0,0 +1,4 @@
1
+ module DeployGate
2
+ class RavenIgnoreException < StandardError
3
+ end
4
+ end
@@ -1,6 +1,6 @@
1
1
  module DeployGate
2
2
  class Session
3
- class LoginError < DeployGate::NotIssueError
3
+ class LoginError < DeployGate::RavenIgnoreException
4
4
  end
5
5
 
6
6
  attr_reader :name, :token
@@ -1,3 +1,3 @@
1
1
  module DeployGate
2
- VERSION = '0.6.7'
2
+ VERSION = '0.6.8'
3
3
  end
@@ -9,7 +9,7 @@ module DeployGate
9
9
  PROVISIONING_STYLE_AUTOMATIC = 'Automatic'
10
10
  PROVISIONING_STYLE_MANUAL = 'Manual'
11
11
 
12
- class BundleIdentifierDifferentError < DeployGate::NotIssueError
12
+ class BundleIdentifierDifferentError < DeployGate::RavenIgnoreException
13
13
  end
14
14
 
15
15
  # @param [Array] workspaces
@@ -5,7 +5,7 @@ module DeployGate
5
5
  PROJECT_DIR_EXTNAME = '.xcodeproj'
6
6
  IGNORE_DIRS = [ '.git', 'Carthage' ]
7
7
 
8
- class NotSupportExportMethodError < DeployGate::NotIssueError
8
+ class NotSupportExportMethodError < DeployGate::RavenIgnoreException
9
9
  end
10
10
 
11
11
  class << self
@@ -4,9 +4,9 @@ module DeployGate
4
4
  class ProvisioningProfile
5
5
  attr_reader :member_center, :app_identifier
6
6
 
7
- class NotInstalledCertificateError < DeployGate::NotIssueError
7
+ class NotInstalledCertificateError < DeployGate::RavenIgnoreException
8
8
  end
9
- class NotExistUUIDProvisioningProfileError < DeployGate::NotIssueError
9
+ class NotExistUUIDProvisioningProfileError < DeployGate::RavenIgnoreException
10
10
  end
11
11
 
12
12
  OUTPUT_PATH = '/tmp/dg/provisioning_profile/'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploygate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - deploygate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -72,28 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.5.1
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 1.5.1
83
- - !ruby/object:Gem::Dependency
84
- name: github_issue_request
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.1'
75
+ version: '1.7'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '0.1'
82
+ version: '1.7'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: highline
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +220,20 @@ dependencies:
234
220
  - - "~>"
235
221
  - !ruby/object:Gem::Version
236
222
  version: '0.6'
223
+ - !ruby/object:Gem::Dependency
224
+ name: sentry-raven
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '2.8'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '2.8'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: fastlane
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -254,14 +254,14 @@ dependencies:
254
254
  requirements:
255
255
  - - "~>"
256
256
  - !ruby/object:Gem::Version
257
- version: '1.13'
257
+ version: '1.17'
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
- version: '1.13'
264
+ version: '1.17'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: rake
267
267
  requirement: !ruby/object:Gem::Requirement
@@ -362,8 +362,8 @@ files:
362
362
  - lib/deploygate/config/cache_version.rb
363
363
  - lib/deploygate/config/credential.rb
364
364
  - lib/deploygate/deploy.rb
365
- - lib/deploygate/not_issue_error.rb
366
365
  - lib/deploygate/project.rb
366
+ - lib/deploygate/raven_ignore_exception.rb
367
367
  - lib/deploygate/session.rb
368
368
  - lib/deploygate/user.rb
369
369
  - lib/deploygate/version.rb
@@ -418,8 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
418
418
  - !ruby/object:Gem::Version
419
419
  version: '0'
420
420
  requirements: []
421
- rubyforge_project:
422
- rubygems_version: 2.7.7
421
+ rubygems_version: 3.0.2
423
422
  signing_key:
424
423
  specification_version: 4
425
424
  summary: A command-line interface for DeployGate
@@ -1,4 +0,0 @@
1
- module DeployGate
2
- class NotIssueError < StandardError
3
- end
4
- end