fastlane-plugin-sentry 0 → 0.1.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 +5 -5
- data/LICENSE +1 -1
- data/README.md +13 -256
- data/lib/fastlane/plugin/sentry/actions/sentry_upload_dsym.rb +137 -0
- data/lib/fastlane/plugin/sentry/helper/sentry_helper.rb +5 -80
- data/lib/fastlane/plugin/sentry/version.rb +1 -1
- data/lib/fastlane/plugin/sentry.rb +1 -1
- metadata +24 -56
- data/bin/sentry-cli-Darwin-universal +0 -0
- data/bin/sentry-cli-Linux-i686 +0 -0
- data/bin/sentry-cli-Linux-x86_64 +0 -0
- data/bin/sentry-cli-Windows-i686.exe +0 -0
- data/bin/sentry-cli-Windows-x86_64.exe +0 -0
- data/lib/fastlane/plugin/sentry/actions/sentry_check_cli_installed.rb +0 -41
- data/lib/fastlane/plugin/sentry/actions/sentry_create_deploy.rb +0 -98
- data/lib/fastlane/plugin/sentry/actions/sentry_create_release.rb +0 -77
- data/lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb +0 -162
- data/lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb +0 -75
- data/lib/fastlane/plugin/sentry/actions/sentry_set_commits.rb +0 -99
- data/lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb +0 -132
- data/lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb +0 -88
- data/lib/fastlane/plugin/sentry/actions/sentry_upload_sourcemap.rb +0 -209
- data/lib/fastlane/plugin/sentry/helper/sentry_config.rb +0 -100
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 4e4e1026c44ce53c9ff974f0d6cc23ee99d29ffa
|
|
4
|
+
data.tar.gz: 70f0190de9c4e90bacb0f6616b018054db32277d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b85ad1148d9974c6a336b37485e2a8fb13ba6d6d9ea832453fd211d0f1b1ee6dbb2d4e3dba0e66fa6ac064c92010466aaa30337ce5ae80631a5fbf8d9725e5ac
|
|
7
|
+
data.tar.gz: ba762ed8f8ab7d741244b672c2410f7672e3d0e885c53395775142833889d6cbc82e09dc96652f38d6b2cae181bb47c3de8d6dbb204eb8ec61762cf38a1e02ea
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,287 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://sentry.io" target="_blank" align="center">
|
|
3
|
-
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
|
|
4
|
-
</a>
|
|
5
|
-
<br/>
|
|
6
|
-
<h1>Sentry Fastlane Plugin</h1>
|
|
7
|
-
</p>
|
|
1
|
+
# fastlane-plugin-sentry `fastlane` Plugin
|
|
8
2
|
|
|
9
|
-
[](https://github.com/getsentry/sentry-fastlane/actions?query=workflow%3A"test")
|
|
11
|
-
[](https://badge.fury.io/rb/fastlane-plugin-sentry)
|
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-sentry)
|
|
12
4
|
|
|
13
5
|
## Getting Started
|
|
14
6
|
|
|
15
|
-
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with fastlane-plugin-sentry,
|
|
16
|
-
|
|
17
|
-
### Globally
|
|
18
|
-
|
|
19
|
-
If you install the gem globally, you can run it with any project that is setup for using `fastlane`.
|
|
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:
|
|
20
8
|
|
|
21
9
|
```bash
|
|
22
|
-
|
|
10
|
+
fastlane add_plugin sentry
|
|
23
11
|
```
|
|
24
12
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Locally
|
|
28
|
-
|
|
29
|
-
You can also add the plugin for individual projects. Navigate to your project where `fastlane` is already set up and run the following command:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
bundle exec fastlane add_plugin sentry
|
|
33
|
-
```
|
|
13
|
+
## About sentry
|
|
34
14
|
|
|
35
|
-
|
|
15
|
+
This action allows you to upload symbolication files to Sentry.
|
|
36
16
|
|
|
37
17
|
```ruby
|
|
38
|
-
|
|
39
|
-
#
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
gem 'fastlane-plugin-sentry'
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Add the actions you want to use to your `Fastfile` file and call `bundle exec fastlane` to run.
|
|
46
|
-
|
|
47
|
-
## Sentry Actions
|
|
48
|
-
|
|
49
|
-
A subset of actions provided by the CLI: https://docs.sentry.io/learn/cli/
|
|
50
|
-
|
|
51
|
-
### Authentication & Configuration
|
|
52
|
-
|
|
53
|
-
`auth_token` is the authentication method with Sentry. This can be obtained on https://sentry.io/api/.
|
|
54
|
-
Also note that as of version `1.2.0` you no longer have to provide the required parameters, we will try to fallback to your `.sentryclirc` config file if possible.
|
|
55
|
-
|
|
56
|
-
The following environment variables may be used in place of parameters: `SENTRY_AUTH_TOKEN`, `SENTRY_ORG_SLUG`, and `SENTRY_PROJECT_SLUG`.
|
|
57
|
-
|
|
58
|
-
### Uploading Debug Information Files
|
|
59
|
-
|
|
60
|
-
```ruby
|
|
61
|
-
sentry_debug_files_upload(
|
|
62
|
-
auth_token: '...',
|
|
18
|
+
sentry_upload_dsym(
|
|
19
|
+
api_key: '...', # Do not use if using auth_token
|
|
20
|
+
auth_token: '...', # Do not use if using api_key
|
|
63
21
|
org_slug: '...',
|
|
64
22
|
project_slug: '...',
|
|
65
|
-
|
|
23
|
+
dsym_path: './App.dSYM.zip'
|
|
66
24
|
)
|
|
67
25
|
```
|
|
68
26
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Further options:
|
|
72
|
-
|
|
73
|
-
- __type__: Optional. Only consider debug information files of the given type. By default, all types are considered. Valid options: 'bcsymbolmap', 'breakpad', 'dsym', 'elf', 'jvm', 'pdb', 'pe', 'portablepdb', 'sourcebundle', 'wasm'.
|
|
74
|
-
- __no_unwind__: Optional. Do not scan for stack unwinding information. Specify this flag for builds with disabled FPO, or when stackwalking occurs on the device. This usually excludes executables and dynamic libraries. They might still be uploaded, if they contain additional processable information (see other flags).
|
|
75
|
-
- __no_debug__: Optional. Do not scan for debugging information. This will usually exclude debug companion files. They might still be uploaded, if they contain additional processable information (see other flags).
|
|
76
|
-
- __no_sources__: Optional. Do not scan for source information. This will usually exclude source bundle files. They might still be uploaded, if they contain additional processable information (see other flags).
|
|
77
|
-
- __id__: Optional. Search for specific debug identifiers.
|
|
78
|
-
- __require_all__: Optional. Errors if not all identifiers specified with --id could be found.
|
|
79
|
-
- __symbol_maps__: Optional. Path to BCSymbolMap files which are used to resolve hidden symbols in dSYM files downloaded from iTunes Connect. This requires the dsymutil tool to be available.
|
|
80
|
-
- __derived_data__: Optional. Search for debug symbols in Xcode's derived data.
|
|
81
|
-
- __no_zips__: Optional. Do not search in ZIP files.
|
|
82
|
-
- __no_upload__: Optional. Disable the actual upload. This runs all steps for the processing but does not trigger the upload. This is useful if you just want to verify the setup or skip the upload in tests.
|
|
83
|
-
- __include_sources__: Optional. Include sources from the local file system and upload them as source bundles.
|
|
84
|
-
- __wait__: Optional. Wait for the server to fully process uploaded files. Errors can only be displayed if --wait or --wait-for is specified, but this will significantly slow down the upload process.
|
|
85
|
-
- __wait_for__: Optional. Wait for the server to fully process uploaded files, but at most for the given number of seconds. Errors can only be displayed if --wait or --wait-for is specified, but this will significantly slow down the upload process.
|
|
86
|
-
- __il2cpp_mapping__: Optional. Compute il2cpp line mappings and upload them along with sources.
|
|
87
|
-
|
|
88
|
-
### Uploading iOS Build Archives
|
|
89
|
-
|
|
90
|
-
Upload iOS build archives (.xcarchive) to Sentry for improved symbolication and source context.
|
|
91
|
-
|
|
92
|
-
```ruby
|
|
93
|
-
sentry_upload_build(
|
|
94
|
-
auth_token: '...',
|
|
95
|
-
org_slug: '...',
|
|
96
|
-
project_slug: '...',
|
|
97
|
-
xcarchive_path: './build/MyApp.xcarchive', # Path to your .xcarchive file
|
|
98
|
-
# Optional git context parameters (can also be set via environment variables)
|
|
99
|
-
head_sha: 'abc123...', # The SHA of the head of the current branch (or SENTRY_HEAD_SHA)
|
|
100
|
-
base_sha: 'def456...', # The SHA of the base branch (or SENTRY_BASE_SHA)
|
|
101
|
-
vcs_provider: 'github', # Version control system provider (e.g., 'github', 'gitlab') (or SENTRY_VCS_PROVIDER)
|
|
102
|
-
head_repo_name: 'owner/repo-name', # Name of the head repository (or SENTRY_HEAD_REPO_NAME)
|
|
103
|
-
base_repo_name: 'owner/repo-name', # Name of the base repository (or SENTRY_BASE_REPO_NAME)
|
|
104
|
-
head_ref: 'feature-branch', # Name of the head branch (or SENTRY_HEAD_REF)
|
|
105
|
-
base_ref: 'main', # Name of the base branch (or SENTRY_BASE_REF)
|
|
106
|
-
pr_number: '123', # Pull request number (or SENTRY_PR_NUMBER)
|
|
107
|
-
build_configuration: 'Release', # Build configuration (e.g., 'Release', 'Debug') (or SENTRY_BUILD_CONFIGURATION)
|
|
108
|
-
release_notes: 'Fixed critical bugs', # Optional. Release notes to use for the upload
|
|
109
|
-
force_git_metadata: false, # Optional. Force collection and sending of git metadata
|
|
110
|
-
no_git_metadata: false # Optional. Disable collection and sending of git metadata
|
|
111
|
-
)
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
By default the `SharedValue::XCODEBUILD_ARCHIVE` sets the `xcarchive_path` parameter if set by a prior lane such as `build_app`.
|
|
115
|
-
|
|
116
|
-
This action is only supported on iOS platform.
|
|
117
|
-
|
|
118
|
-
### Creating & Finalizing Releases
|
|
119
|
-
|
|
120
|
-
```ruby
|
|
121
|
-
sentry_create_release(
|
|
122
|
-
auth_token: '...',
|
|
123
|
-
org_slug: '...',
|
|
124
|
-
project_slug: '...',
|
|
125
|
-
version: '...', # release version to create
|
|
126
|
-
app_identifier: '...', # pass in the bundle_identifer of your app
|
|
127
|
-
finalize: true, # Whether to finalize the release. If not provided or false, the release can be finalized using the sentry_finalize_release action
|
|
128
|
-
release_url: 'https://github.com/owner/repo/releases/tag/v1.0.0' # Optional. URL to the release for information purposes
|
|
129
|
-
)
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Uploading Files & Sourcemaps
|
|
133
|
-
|
|
134
|
-
Useful for uploading build artifacts and JS sourcemaps for react-native apps built using fastlane.
|
|
135
|
-
|
|
136
|
-
```ruby
|
|
137
|
-
sentry_upload_sourcemap(
|
|
138
|
-
auth_token: '...',
|
|
139
|
-
org_slug: '...',
|
|
140
|
-
project_slug: '...',
|
|
141
|
-
version: '...',
|
|
142
|
-
app_identifier: '...', # pass in the bundle_identifer of your app
|
|
143
|
-
build: '...', # Optionally pass in the build number of your app
|
|
144
|
-
dist: '...', # optional distribution of the release usually the buildnumber
|
|
145
|
-
sourcemap: ['main.jsbundle', 'main.jsbundle.map'], # Sourcemap(s) to upload. Path(s) can be a comma-separated string or an array of strings.
|
|
146
|
-
rewrite: true, # Rewrite the sourcemaps before upload (default: false)
|
|
147
|
-
url_prefix: '~/', # Optional. Sets a URL prefix in front of all files
|
|
148
|
-
url_suffix: '.map', # Optional. Sets a URL suffix to append to all filenames
|
|
149
|
-
note: 'Build from CI', # Optional. Adds a note to the uploaded artifact bundle
|
|
150
|
-
validate: true, # Optional. Enable basic sourcemap validation
|
|
151
|
-
decompress: true, # Optional. Enable files gzip decompression prior to upload
|
|
152
|
-
wait: true, # Optional. Wait for the server to fully process uploaded files
|
|
153
|
-
wait_for: 60, # Optional. Wait for the server to fully process uploaded files, but at most for the given number of seconds
|
|
154
|
-
strict: true # Optional. Fail with a non-zero exit code if the specified source map file cannot be uploaded
|
|
155
|
-
)
|
|
156
|
-
```
|
|
27
|
+
`auth_token` is the preferred way to authentication method with Sentry. `api_key` will eventually become deprecated.
|
|
157
28
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
```ruby
|
|
161
|
-
sentry_upload_proguard(
|
|
162
|
-
auth_token: '...',
|
|
163
|
-
org_slug: '...',
|
|
164
|
-
project_slug: '...',
|
|
165
|
-
mapping_path: 'path to mapping.txt to upload',
|
|
166
|
-
no_upload: false, # Optional. Disable the actual upload (useful for verification)
|
|
167
|
-
write_properties: 'path/to/properties/file', # Optional. Write UUIDs for processed mapping files into properties file
|
|
168
|
-
require_one: true, # Optional. Require at least one file to upload or the command will error
|
|
169
|
-
uuid: 'custom-uuid' # Optional. Explicitly override the UUID of the mapping file
|
|
170
|
-
)
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Associating commits
|
|
174
|
-
|
|
175
|
-
Useful for telling Sentry which commits are associated with a release.
|
|
176
|
-
|
|
177
|
-
```ruby
|
|
178
|
-
sentry_set_commits(
|
|
179
|
-
version: '...',
|
|
180
|
-
app_identifier: '...', # pass in the bundle_identifer of your app
|
|
181
|
-
build: '...', # Optionally pass in the build number of your app
|
|
182
|
-
auto: false, # enable completely automated commit management
|
|
183
|
-
clear: false, # clear all current commits from the release
|
|
184
|
-
commit: '...', # commit spec, see `sentry-cli releases help set-commits` for more information
|
|
185
|
-
ignore_missing: false, # Optional boolean value: When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command.
|
|
186
|
-
local: false, # Optional. Set commits of a release from local git
|
|
187
|
-
initial_depth: 20 # Optional. Set the number of commits of the initial release (default: 20)
|
|
188
|
-
)
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Create deploy
|
|
192
|
-
|
|
193
|
-
Creates a new release deployment for a project on Sentry.
|
|
194
|
-
|
|
195
|
-
```ruby
|
|
196
|
-
sentry_create_deploy(
|
|
197
|
-
auth_token: '...',
|
|
198
|
-
org_slug: '...',
|
|
199
|
-
project_slug: '...',
|
|
200
|
-
version: '...',
|
|
201
|
-
app_identifier: '...', # pass in the bundle_identifer of your app
|
|
202
|
-
build: '...', # Optionally pass in the build number of your app
|
|
203
|
-
env: 'staging', # The environment for this deploy. Required.
|
|
204
|
-
name: '...', # Optional human readable name
|
|
205
|
-
deploy_url: '...', # Optional URL that points to the deployment
|
|
206
|
-
started: 1622630647, # Optional unix timestamp when the deployment started
|
|
207
|
-
finished: 1622630700, # Optional unix timestamp when the deployment finished
|
|
208
|
-
time: 180 # Optional deployment duration in seconds. This can be specified alternatively to `started` and `finished`
|
|
209
|
-
)
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Specify custom sentry-cli path
|
|
213
|
-
|
|
214
|
-
Starting with version `1.13.0`, the plugin bundles both macOS and Windows 64 bit executables of `sentry-cli`. You can also specify a custom `sentry-cli` path by adding `sentry_cli_path` to any action.
|
|
215
|
-
|
|
216
|
-
### Checking the sentry-cli is installed
|
|
217
|
-
|
|
218
|
-
Useful for checking that the sentry-cli is installed and meets the minimum version requirements before starting to build your app in your lane.
|
|
219
|
-
|
|
220
|
-
```ruby
|
|
221
|
-
sentry_check_cli_installed()
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Logging
|
|
225
|
-
|
|
226
|
-
You can set the `sentry-cli` [configuration value](https://docs.sentry.io/product/cli/configuration/#configuration-values) `SENTRY_LOG_LEVEL` by adding `log_level` to any action. Supported values are 'trace', 'debug', 'info', 'warn' and 'error'.
|
|
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`.
|
|
227
30
|
|
|
228
31
|
## Issues and Feedback
|
|
229
32
|
|
|
230
33
|
For any other issues and feedback about this plugin, please submit it to this repository.
|
|
231
34
|
|
|
232
|
-
## Migration Guide
|
|
233
|
-
|
|
234
|
-
### Migrating from sentry-fastlane-plugin v1 to v2
|
|
235
|
-
|
|
236
|
-
When upgrading to the latest version of this plugin (which uses sentry-cli v3), you may need to update your Fastfiles. Here are the key changes:
|
|
237
|
-
|
|
238
|
-
#### Parameter Name Changes
|
|
239
|
-
|
|
240
|
-
- **`sentry_debug_files_upload`**: The `ids` parameter has been renamed to `id` (singular). Update your Fastfiles:
|
|
241
|
-
```ruby
|
|
242
|
-
# Before
|
|
243
|
-
sentry_debug_files_upload(ids: 'abc123')
|
|
244
|
-
|
|
245
|
-
# After
|
|
246
|
-
sentry_debug_files_upload(id: 'abc123')
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
#### Removed Parameters
|
|
250
|
-
|
|
251
|
-
The following parameters have been removed as they are no longer supported in sentry-cli v3:
|
|
252
|
-
|
|
253
|
-
- **`sentry_debug_files_upload`**: Remove `info_plist`, `no_reprocessing`, and `upload_symbol_maps` parameters if you're using them.
|
|
254
|
-
- **`sentry_upload_proguard`**: Remove `android_manifest_path` parameter if you're using it (no longer needed).
|
|
255
|
-
|
|
256
|
-
#### New Available Options
|
|
257
|
-
|
|
258
|
-
Many new options have been added to match sentry-cli v3 capabilities. See the action documentation above for all available options. Some notable additions:
|
|
259
|
-
|
|
260
|
-
- **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Type validation now includes `jvm`, `portablepdb`, and `wasm`.
|
|
261
|
-
- **`sentry_upload_sourcemap`**: Added `url_suffix`, `note`, `validate`, `decompress`, `wait`, `wait_for`, `no_sourcemap_reference`, `debug_id_reference`, `bundle`, `bundle_sourcemap`, `ext`, and `strict` options.
|
|
262
|
-
- **`sentry_upload_proguard`**: Added `no_upload`, `write_properties`, `require_one`, and `uuid` options.
|
|
263
|
-
- **`sentry_upload_build`**: Added `release_notes`, `force_git_metadata`, and `no_git_metadata` options.
|
|
264
|
-
- **`sentry_create_release`**: Added `url` option.
|
|
265
|
-
- **`sentry_finalize_release`**: Added `url` and `released` options.
|
|
266
|
-
- **`sentry_set_commits`**: Added `local` and `initial_depth` options.
|
|
267
|
-
|
|
268
|
-
#### Removed Actions
|
|
269
|
-
|
|
270
|
-
The following actions have been removed and replaced:
|
|
271
|
-
|
|
272
|
-
- **`sentry_upload_file`**: Use `sentry_upload_sourcemap` for source maps or other specialized upload actions.
|
|
273
|
-
- **`sentry_upload_dsym`**: Use `sentry_debug_files_upload` with appropriate `path` parameter.
|
|
274
|
-
- **`sentry_upload_dif`**: Use `sentry_debug_files_upload` with appropriate `path` parameter.
|
|
275
|
-
|
|
276
|
-
For more details on sentry-cli v3 changes, see the [sentry-cli 3.0.0 release notes](https://github.com/getsentry/sentry-cli/releases/tag/3.0.0).
|
|
277
|
-
|
|
278
35
|
## Troubleshooting
|
|
279
36
|
|
|
280
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.
|
|
281
38
|
|
|
282
39
|
## Using `fastlane` Plugins
|
|
283
40
|
|
|
284
|
-
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://
|
|
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.
|
|
285
42
|
|
|
286
43
|
## About `fastlane`
|
|
287
44
|
|
|
@@ -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
|
|
@@ -1,86 +1,11 @@
|
|
|
1
|
-
require 'os'
|
|
2
|
-
|
|
3
1
|
module Fastlane
|
|
4
2
|
module Helper
|
|
5
3
|
class SentryHelper
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sentry_cli_version = Gem::Version.new(`#{sentry_cli_path} --version`.scan(/(?:\d+\.?){3}/).first)
|
|
13
|
-
|
|
14
|
-
if sentry_cli_version < bundled_sentry_cli_version
|
|
15
|
-
UI.user_error!("Your sentry-cli is outdated, please upgrade to at least version #{bundled_sentry_cli_version} and start your lane again!")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
UI.success("Using sentry-cli #{sentry_cli_version}")
|
|
19
|
-
sentry_cli_path
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def self.call_sentry_cli(params, sub_command)
|
|
23
|
-
sentry_path = self.find_and_check_sentry_cli_path!(params)
|
|
24
|
-
command = [sentry_path] + sub_command
|
|
25
|
-
UI.message "Starting sentry-cli..."
|
|
26
|
-
require 'open3'
|
|
27
|
-
|
|
28
|
-
final_command = command.map { |arg| Shellwords.escape(arg) }.join(" ")
|
|
29
|
-
|
|
30
|
-
if FastlaneCore::Globals.verbose?
|
|
31
|
-
UI.command(final_command)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
env = { 'SENTRY_PIPELINE' => "sentry-fastlane-plugin/#{Fastlane::Sentry::VERSION}" }
|
|
35
|
-
Open3.popen3(env, final_command) do |stdin, stdout, stderr, status_thread|
|
|
36
|
-
out_reader = Thread.new do
|
|
37
|
-
output = []
|
|
38
|
-
|
|
39
|
-
stdout.each_line do |line|
|
|
40
|
-
l = line.strip!
|
|
41
|
-
UI.message(l)
|
|
42
|
-
output << l
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
output.join
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
err_reader = Thread.new do
|
|
49
|
-
stderr.each_line do |line|
|
|
50
|
-
UI.message(line.strip!)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
unless status_thread.value.success?
|
|
55
|
-
UI.user_error!('Error while calling Sentry CLI')
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
err_reader.join
|
|
59
|
-
out_reader.value
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def self.bundled_sentry_cli_path
|
|
64
|
-
if OS.mac?
|
|
65
|
-
self.bin_folder('sentry-cli-Darwin-universal')
|
|
66
|
-
elsif OS.windows?
|
|
67
|
-
if OS.bits == 64
|
|
68
|
-
self.bin_folder('sentry-cli-Windows-x86_64.exe')
|
|
69
|
-
else
|
|
70
|
-
self.bin_folder('sentry-cli-Windows-i686.exe')
|
|
71
|
-
end
|
|
72
|
-
else
|
|
73
|
-
if OS.bits == 64
|
|
74
|
-
self.bin_folder('sentry-cli-Linux-x86_64')
|
|
75
|
-
else
|
|
76
|
-
self.bin_folder('sentry-cli-Linux-i686')
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
# Get path for files in bin folder. Paths are resolved relative to this file, for which there are also unit tests.
|
|
82
|
-
def self.bin_folder(filename)
|
|
83
|
-
File.expand_path("../../../../../bin/#{filename}", File.dirname(__FILE__))
|
|
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!")
|
|
84
9
|
end
|
|
85
10
|
end
|
|
86
11
|
end
|
|
@@ -2,7 +2,7 @@ require 'fastlane/plugin/sentry/version'
|
|
|
2
2
|
|
|
3
3
|
module Fastlane
|
|
4
4
|
module Sentry
|
|
5
|
-
# Return all .rb files inside the "actions" and "helper"
|
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
|
6
6
|
def self.all_classes
|
|
7
7
|
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
|
8
8
|
end
|