fastlane-plugin-sentry 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4e4e1026c44ce53c9ff974f0d6cc23ee99d29ffa
4
+ data.tar.gz: 70f0190de9c4e90bacb0f6616b018054db32277d
5
+ SHA512:
6
+ metadata.gz: b85ad1148d9974c6a336b37485e2a8fb13ba6d6d9ea832453fd211d0f1b1ee6dbb2d4e3dba0e66fa6ac064c92010466aaa30337ce5ae80631a5fbf8d9725e5ac
7
+ data.tar.gz: ba762ed8f8ab7d741244b672c2410f7672e3d0e885c53395775142833889d6cbc82e09dc96652f38d6b2cae181bb47c3de8d6dbb204eb8ec61762cf38a1e02ea
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Josh Holtz <josh@rokkincat.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # fastlane-plugin-sentry `fastlane` Plugin
2
+
3
+ [![fastlane Plugin Badge](https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-sentry)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with fastlane-plugin-sentry, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin sentry
11
+ ```
12
+
13
+ ## About sentry
14
+
15
+ This action allows you to upload symbolication files to Sentry.
16
+
17
+ ```ruby
18
+ sentry_upload_dsym(
19
+ api_key: '...', # Do not use if using auth_token
20
+ auth_token: '...', # Do not use if using api_key
21
+ org_slug: '...',
22
+ project_slug: '...',
23
+ dsym_path: './App.dSYM.zip'
24
+ )
25
+ ```
26
+
27
+ `auth_token` is the preferred way to authentication method with Sentry. `api_key` will eventually become deprecated.
28
+
29
+ The following environment variables may be used in place of parameters: `SENTRY_API_KEY`, `SENTRY_AUTH_TOKEN`, `SENTRY_ORG_SLUG`, `SENTRY_PROJECT_SLUG`, and `SENTRY_DSYM_PATH`.
30
+
31
+ ## Issues and Feedback
32
+
33
+ For any other issues and feedback about this plugin, please submit it to this repository.
34
+
35
+ ## Troubleshooting
36
+
37
+ For some more detailed help with plugins problems, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
38
+
39
+ ## Using `fastlane` Plugins
40
+
41
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md) in the main `fastlane` repo.
42
+
43
+ ## About `fastlane`
44
+
45
+ `fastlane` automates building, testing, and releasing your app for beta and app store distributions. To learn more about `fastlane`, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/sentry/version'
2
+
3
+ module Fastlane
4
+ module Sentry
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::Sentry.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,137 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SentryUploadDsymAction < Action
4
+ def self.run(params)
5
+
6
+ require 'rest-client'
7
+
8
+ # Params - API
9
+ host = params[:api_host]
10
+ api_key = params[:api_key]
11
+ auth_token = params[:auth_token]
12
+ org = params[:org_slug]
13
+ project = params[:project_slug]
14
+
15
+ # Params - dSYM
16
+ dsym_path = params[:dsym_path]
17
+ dsym_paths = params[:dsym_paths] || []
18
+
19
+ has_api_key = !api_key.to_s.empty?
20
+ has_auth_token = !auth_token.to_s.empty?
21
+
22
+ # Will fail if none or both authentication methods are provided
23
+ if !has_api_key && !has_auth_token
24
+ UI.user_error!("No API key or authentication token found for SentryAction given, pass using `api_key: 'key'` or `auth_token: 'token'`")
25
+ elsif has_api_key && has_auth_token
26
+ UI.user_error!("Both API key and authentication token found for SentryAction given, please only give one")
27
+ end
28
+
29
+ # Url to post dSYMs to
30
+ url = "#{host}/projects/#{org}/#{project}/files/dsyms/"
31
+ if has_api_key
32
+ resource = RestClient::Resource.new( url, api_key, '' )
33
+ else
34
+ resource = RestClient::Resource.new( url, headers: {Authorization: "Bearer #{auth_token}"} )
35
+ end
36
+
37
+ UI.message "Will upload dSYM(s) to #{url}"
38
+
39
+ # Upload dsym(s)
40
+ dsym_paths += [dsym_path]
41
+ uploaded_paths = dsym_paths.compact.map do |dsym|
42
+ upload_dsym(resource, dsym)
43
+ end
44
+
45
+ # Return uplaoded dSYM paths
46
+ uploaded_paths
47
+ end
48
+
49
+ def self.upload_dsym(resource, dsym)
50
+ UI.message "Uploading... #{dsym}"
51
+ resource.post(file: File.new(dsym, 'rb')) unless Helper.test?
52
+ UI.success 'dSYM successfully uploaded to Sentry!'
53
+
54
+ dsym
55
+ rescue
56
+ UI.user_error! 'Error while trying to upload dSYM to Sentry'
57
+ end
58
+
59
+ #####################################################
60
+ # @!group Documentation
61
+ #####################################################
62
+
63
+ def self.description
64
+ "Upload dSYM symbolication files to Sentry"
65
+ end
66
+
67
+ def self.details
68
+ [
69
+ "This action allows you to upload symbolication files to Sentry.",
70
+ "It's extra useful if you use it to download the latest dSYM files from Apple when you",
71
+ "use Bitcode"
72
+ ].join(" ")
73
+ end
74
+
75
+ def self.available_options
76
+ [
77
+ FastlaneCore::ConfigItem.new(key: :api_host,
78
+ env_name: "SENTRY_HOST",
79
+ description: "API host url for Sentry",
80
+ is_string: true,
81
+ default_value: "https://app.getsentry.com/api/0",
82
+ optional: true
83
+ ),
84
+ FastlaneCore::ConfigItem.new(key: :api_key,
85
+ env_name: "SENTRY_API_KEY",
86
+ description: "API key for Sentry",
87
+ optional: true),
88
+ FastlaneCore::ConfigItem.new(key: :auth_token,
89
+ env_name: "SENTRY_AUTH_TOKEN",
90
+ description: "Authentication token for Sentry",
91
+ optional: true),
92
+ FastlaneCore::ConfigItem.new(key: :org_slug,
93
+ env_name: "SENTRY_ORG_SLUG",
94
+ description: "Organization slug for Sentry project",
95
+ verify_block: proc do |value|
96
+ UI.user_error!("No organization slug for SentryAction given, pass using `org_slug: 'org'`") unless value and !value.empty?
97
+ end),
98
+ FastlaneCore::ConfigItem.new(key: :project_slug,
99
+ env_name: "SENTRY_PROJECT_SLUG",
100
+ description: "Prgoject slug for Sentry",
101
+ verify_block: proc do |value|
102
+ UI.user_error!("No project slug for SentryAction given, pass using `project_slug: 'project'`") unless value and !value.empty?
103
+ end),
104
+ FastlaneCore::ConfigItem.new(key: :dsym_path,
105
+ env_name: "SENTRY_DSYM_PATH",
106
+ description: "Path to your symbols file. For iOS and Mac provide path to app.dSYM.zip",
107
+ default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
108
+ optional: true,
109
+ verify_block: proc do |value|
110
+ # validation is done in the action
111
+ end),
112
+ FastlaneCore::ConfigItem.new(key: :dsym_paths,
113
+ env_name: "SENTRY_DSYM_PATHS",
114
+ description: "Path to an array of your symbols file. For iOS and Mac provide path to app.dSYM.zip",
115
+ default_value: Actions.lane_context[SharedValues::DSYM_PATHS],
116
+ is_string: false,
117
+ optional: true,
118
+ verify_block: proc do |value|
119
+ # validation is done in the action
120
+ end)
121
+ ]
122
+ end
123
+
124
+ def self.return_value
125
+ "The uploaded dSYM path(s)"
126
+ end
127
+
128
+ def self.authors
129
+ ["joshdholtz"]
130
+ end
131
+
132
+ def self.is_supported?(platform)
133
+ platform == :ios
134
+ end
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,12 @@
1
+ module Fastlane
2
+ module Helper
3
+ class SentryHelper
4
+ # class methods that you define here become available in your action
5
+ # as `Helper::SentryHelper.your_method`
6
+ #
7
+ def self.show_message
8
+ UI.message("Hello from the sentry plugin helper!")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module Sentry
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-sentry
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Josh Holtz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.6.7
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.6.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
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'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fastlane
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.93.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.93.0
83
+ description:
84
+ email: josh@rokkincat.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - LICENSE
90
+ - README.md
91
+ - lib/fastlane/plugin/sentry.rb
92
+ - lib/fastlane/plugin/sentry/actions/sentry_upload_dsym.rb
93
+ - lib/fastlane/plugin/sentry/helper/sentry_helper.rb
94
+ - lib/fastlane/plugin/sentry/version.rb
95
+ homepage: https://github.com/getsentry/sentry-fastlane
96
+ licenses:
97
+ - MIT
98
+ metadata: {}
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.4.5
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: Upload symbols to Sentry
119
+ test_files: []
120
+ has_rdoc: