fastlane-plugin-dynatrace 1.0.7 → 2.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c236c8f7da15577b17f9c2515214671eb4e95c1f4cc5c1891105cc7ade2a59b2
|
4
|
+
data.tar.gz: 4725bb74807832a320be5c4fb6aaf1b29bd6de7e3cfd4880fc1931e6dcb02589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5897a23dec9c27f728c55b4de5ff3ffab050a272a2825fdf066717417fcda7d88687792d4179ad0c53b0553acc659461eaf21141b6f6617b5f005796941a171c
|
7
|
+
data.tar.gz: e36ce10fc9a35a563992c3e675999377073b6641f6b3325427838c79e00941d19e6f27b50fc55e68310d260fd747a05cfdd4fcad560df4080c68df841d016229
|
data/README.md
CHANGED
@@ -11,67 +11,14 @@ fastlane add_plugin dynatrace
|
|
11
11
|
```
|
12
12
|
|
13
13
|
## About the Dynatrace fastlane plugin
|
14
|
-
The Dynatrace fastlane plugin manages uploading
|
15
|
-
|
16
|
-
The plugin provides a single action `dynatrace_process_symbols`. The configuration depends on whether the app is (A) iOS and Bitcode-enabled or (B) iOS/tvOS and not Bitcode-enabled or an Android app.
|
17
|
-
|
18
|
-
For Bitcode-enabled iOS apps we recommend to let the plugin handle the download of the dSYM files from App Store Connect and upload to Dynatrace.
|
14
|
+
The Dynatrace fastlane plugin manages pre-processing and uploading of dSYM files (iOS, tvOS) or uploading of obfuscation mapping files (Android) to the Dynatrace cluster. Symbol and mapping files are used to make reported stack traces human-readable.
|
19
15
|
|
16
|
+
The plugin provides a single action `dynatrace_process_symbols`. The configuration depends on whether the app is an iOS/tvOS or an Android app.
|
20
17
|
|
21
18
|
## Usage
|
22
|
-
To get started, ask your Dynatrace administrator for an [API token ](https://www.dynatrace.com/support/help/shortlink/api-authentication) with **Mobile symbolication file management** permission . To generate the API token, go to **Integration** > **Dynatrace API**.
|
23
|
-
|
24
|
-
Add the action `dynatrace_process_symbols` to your Fastfile. You'll find all the configuration options and a default configuration later in the readme.
|
25
|
-
|
26
|
-
Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of your app as configured.
|
27
|
-
|
28
|
-
### Dynatrace Managed (1.195 and earlier)
|
29
|
-
For cluster versions 1.195 and earlier, the Dynatrace application 'Symbolication Client' has to be downloaded manually and explicitly specified (`dtxDssClientPath`). For all cluster versions above 1.195 it is fetched and updated automatically. A matching version can be downloaded manually with this link [https://api.mobileagent.downloads.dynatrace.com/sprint-latest-dss-client/xyz](https://api.mobileagent.downloads.dynatrace.com/sprint-latest-dss-client/xyz) by replacing `xyz` with the 3-digit sprint version of your Dynatrace Managed installation.
|
30
|
-
|
31
|
-
|
32
|
-
## A) Bitcode-enabled iOS apps
|
33
|
-
This is the right approach if your app is distributed via Apple's App Store or TestFlight and Bitcode-enabled. For all other cases, follow the approach B below.
|
19
|
+
To get started, ask your Dynatrace administrator for an [API token ](https://www.dynatrace.com/support/help/shortlink/api-authentication) with **Mobile symbolication file management** permission . To generate the API token, go to **Integration** > **Dynatrace API**. The token is used by the authenticate the plugin into Dynatrace and upload the symbol and mapping files.
|
34
20
|
|
35
|
-
|
36
|
-
|
37
|
-
### Automatically downloading dSYMs
|
38
|
-
|
39
|
-
To fully automate the following five-step workflow, add the snippets below to the respective files and fill in the placeholders. Uploading the app to App Store Connect is a necessary prerequisite and either handled manually or by fastlane directly:
|
40
|
-
|
41
|
-
1. Wait until the build is processed
|
42
|
-
2. Download the resulting dSYM files
|
43
|
-
3. Process dSYM files into the format that Dynatrace requires
|
44
|
-
4. Upload processed dSYM files to Dynatrace
|
45
|
-
|
46
|
-
#### Fastfile
|
47
|
-
```ruby
|
48
|
-
dynatrace_process_symbols(
|
49
|
-
appId: "<Dynatrace application ID>",
|
50
|
-
apitoken: "<Dynatrace API token>",
|
51
|
-
os: "ios",
|
52
|
-
bundleId: "<CFBundlebundleId>",
|
53
|
-
versionStr: "<Build Number (CFBundleVersion)>",
|
54
|
-
version: "<App Version (CFBundleShortVersionString)>",
|
55
|
-
server: "<Dynatrace Environment URL>",
|
56
|
-
downloadDsyms: true
|
57
|
-
)
|
58
|
-
```
|
59
|
-
|
60
|
-
#### Waiting time between app upload and dSYM file download
|
61
|
-
After a completed upload to App Store Connect, there is some waiting time before the dSYM files are ready to be downloaded. The Dynatrace fastlane plugin waits and downloads the symbol files if setting the `waitForDsymProcessing` is true and a waiting period is provided via `waitForDsymProcessingTimeout`. We recommend 1800 seconds (30 mins) as the default waiting time. In our experience, this is sufficiently long for the processing to happen. If this duration is not long enough, you need to increase it.
|
62
|
-
|
63
|
-
> Note: this timeout is the **maximum** waiting time. If the symbol files are ready sooner, the plugin will continue to the download and will not wait for the whole duration of the timeout.
|
64
|
-
|
65
|
-
|
66
|
-
## B) Not Bitcode-enabled iOS/tvOS apps or Android apps
|
67
|
-
If at least one of the following conditions is true, you should follow this approach:
|
68
|
-
|
69
|
-
* **not** using Bitcode for your iOS/tvOS app
|
70
|
-
* already downloaded the new symbol files from App Store Connect manually
|
71
|
-
* deploy an Android app
|
72
|
-
|
73
|
-
#### Fastfile
|
74
|
-
Use the parameter `symbolsfile` to provide a relative path to the symbols file.
|
21
|
+
Add the action `dynatrace_process_symbols` to your Fastfile. You'll find all the configuration options and a default configuration below. Use the parameter `symbolsfile` to provide a relative path to the symbols file (dSYM or Android mapping).
|
75
22
|
|
76
23
|
```ruby
|
77
24
|
dynatrace_process_symbols(
|
@@ -86,38 +33,27 @@ dynatrace_process_symbols(
|
|
86
33
|
)
|
87
34
|
```
|
88
35
|
|
36
|
+
Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of your app as configured.
|
37
|
+
|
38
|
+
|
89
39
|
## List of all Parameters
|
90
40
|
| Key | Description | default value |
|
91
41
|
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
|
92
42
|
| action | *(iOS/tvOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
|
93
|
-
| downloadDsyms | *(iOS/tvOS only)* Download the dSYMs from App Store Connect. | `false` |
|
94
|
-
| waitForDsymProcessing | *(iOS/tvOS only)* Wait for dSYM processing to be finished. | `true` |
|
95
|
-
| waitForDsymProcessingTimeout | *(iOS/tvOS only)* Timeout in seconds to wait for the dSYMs be downloadable. | `1800` |
|
96
43
|
| username | *(iOS/tvOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
|
97
44
|
| os | The type of the symbol files, either `ios`, `tvOS` or `android`. | |
|
98
45
|
| apitoken | Dynatrace API token with mobile symbolication permissions. | |
|
99
|
-
| dtxDssClientPath | **(DEPRECATED)** The path to your DTXDssClient. The DTXDssClient is downloaded and updated automatically, unless this key is set. | |
|
100
46
|
| appID | The application ID you get from your Dynatrace environment. | |
|
101
47
|
| bundleId | The CFBundlebundleId (iOS, tvOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
|
102
48
|
| versionStr | The CFBundleShortVersionString (iOS, tvOS) / versionName (Android) | |
|
103
49
|
| version | The CFBundleVersion (iOS, tvOS) / versionCode (Android). Is also used for the dSYM download. | |
|
104
|
-
| symbolsfile | Path to the dSYM file to be processed. If
|
50
|
+
| symbolsfile | Path to the dSYM or Android mapping file to be processed. *(Android only)*: If the file exceeds 10MiB and doesn't end with `*.zip` it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false. | |
|
51
|
+
| symbolsfileAutoZip | *(Android only)* Automatically zip symbolsfile if it exceeds 10MiB and doesn't already end with `*.zip`. | `true` |
|
105
52
|
| server | The API endpoint for the Dynatrace environment (e.g. `https://environmentID.live.dynatrace.com` or `https://dynatrace-managed.com/e/environmentID`). | |
|
106
|
-
| cleanBuildArtifacts | Clean build artifacts after processing. | `
|
53
|
+
| cleanBuildArtifacts | Clean build artifacts after processing. | `false` |
|
107
54
|
| tempdir | (OPTIONAL) Custom temporary directory for the DTXDssClient. **The plugin does not take care of cleaning this directory.** | |
|
108
55
|
| debugMode | Enable debug logging. | false |
|
109
56
|
|
110
|
-
|
111
|
-
### Fastlane Session
|
112
|
-
The full documentation for this can be found on the [fastlane docs](https://docs.fastlane.tools/best-practices/continuous-integration/#two-step-or-two-factor-auth
|
113
|
-
) under **spaceauth**.
|
114
|
-
|
115
|
-
You can generate a session by running `fastlane spaceauth -u user@email.com` on your machine and copy the output into an environment variable `FASTLANE_SESSION` on the target system (e.g. CI).
|
116
|
-
|
117
|
-
> Note:
|
118
|
-
> - Session is only valid for the "region" you created it in. If your CI is in a different geographical location, the authentication might fail
|
119
|
-
> - Generated sessions are valid for up to one month. Apple's API doesn't specify details about that, so it is only noticable by a failing build
|
120
|
-
|
121
57
|
## Example
|
122
58
|
Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
123
59
|
|
@@ -12,13 +12,13 @@ module Fastlane
|
|
12
12
|
class DynatraceProcessSymbolsAction < Action
|
13
13
|
|
14
14
|
def self.run(params)
|
15
|
-
UI.message "DTXDssClientPath: #{params[:dtxDssClientPath]}"
|
16
15
|
UI.message "Parameter API Token: #{params[:apitoken]}"
|
17
16
|
UI.message "OS: #{params[:os]}"
|
18
17
|
UI.message "Version string: #{params[:versionStr]}"
|
19
18
|
UI.message "Version: #{params[:version]}"
|
20
19
|
UI.message "Server URL: #{params[:server]}"
|
21
20
|
UI.message "Tempdir: #{params[:tempdir]}"
|
21
|
+
UI.message "Symbols file path: #{params[:symbolsfile]}"
|
22
22
|
|
23
23
|
UI.message "Checking AppFile for possible AppID"
|
24
24
|
bundleId = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
@@ -30,16 +30,17 @@ module Fastlane
|
|
30
30
|
end
|
31
31
|
|
32
32
|
if params[:os] == "android"
|
33
|
-
|
33
|
+
symbols_path = Helper::DynatraceHelper.zip_if_required(params)
|
34
|
+
response, request = Helper::DynatraceHelper.put_android_symbols(params, bundleId, symbols_path)
|
34
35
|
case response.code
|
35
36
|
when '204'
|
36
|
-
UI.success "
|
37
|
+
UI.success "Success. The file has been uploaded and stored."
|
37
38
|
when '400'
|
38
|
-
UI.user_error! "Failed
|
39
|
+
UI.user_error! "Failed. The input is invalid."
|
39
40
|
when '401'
|
40
41
|
UI.user_error! "Invalid Dynatrace API token. See https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication/#token-permissions and https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/mobile-symbolication-api/"
|
41
42
|
when '413'
|
42
|
-
UI.user_error! "Failed
|
43
|
+
UI.user_error! "Failed. The symbol file storage quota is exhausted. See https://www.dynatrace.com/support/help/shortlink/mobile-symbolication#manage-the-uploaded-symbol-files for more information."
|
43
44
|
else
|
44
45
|
message = nil
|
45
46
|
unless response.body.nil?
|
@@ -59,71 +60,10 @@ module Fastlane
|
|
59
60
|
# iOS/tvOS workflow
|
60
61
|
dtxDssClientPath = Helper::DynatraceHelper.get_dss_client(params)
|
61
62
|
|
62
|
-
dsym_paths = []
|
63
|
-
symbolFilesKey = "symbolsfile" # default to iOS
|
64
|
-
|
65
63
|
if !OS.mac?
|
66
64
|
UI.user_error! "A macOS machine is required to process iOS symbols."
|
67
65
|
end
|
68
66
|
|
69
|
-
if params[:downloadDsyms] == true
|
70
|
-
UI.message "Downloading dSYMs from App Store Connect"
|
71
|
-
startTime = Time.now
|
72
|
-
|
73
|
-
UI.message "Checking AppFile for possible username/AppleID"
|
74
|
-
username = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
|
75
|
-
if username
|
76
|
-
UI.message "Using #{username} from your AppFile"
|
77
|
-
else
|
78
|
-
username = params[:username]
|
79
|
-
UI.message "Didn't find a username in AppFile, using passed username parameter: #{params[:username]}"
|
80
|
-
end
|
81
|
-
|
82
|
-
# it takes a couple of minutes until the new build is available through the API
|
83
|
-
# -> retry until available
|
84
|
-
while params[:waitForDsymProcessing] and # wait is active
|
85
|
-
!lane_context[SharedValues::DSYM_PATHS] and # has dsym path
|
86
|
-
(Time.now - startTime) < params[:waitForDsymProcessingTimeout] # is in time
|
87
|
-
|
88
|
-
Actions::DownloadDsymsAction.run(wait_for_dsym_processing: params[:waitForDsymProcessing],
|
89
|
-
wait_timeout: (params[:waitForDsymProcessingTimeout] - (Time.now - startTime)).round(0), # remaining timeout
|
90
|
-
app_identifier: bundleId,
|
91
|
-
username: username,
|
92
|
-
version: params[:version],
|
93
|
-
build_number: params[:versionStr],
|
94
|
-
platform: params[:os] == "ios" ? :ios : :appletvos)
|
95
|
-
|
96
|
-
if !lane_context[SharedValues::DSYM_PATHS] and (Time.now - startTime) < params[:waitForDsymProcessingTimeout]
|
97
|
-
UI.message "Version #{params[:version]} (Build #{params[:versionStr]}) isn't listed yet, retrying in 60 seconds (timeout in #{(params[:waitForDsymProcessingTimeout] - (Time.now - startTime)).round(0)} seconds)."
|
98
|
-
sleep(60)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
if (Time.now - startTime) > params[:waitForDsymProcessingTimeout]
|
103
|
-
UI.user_error!("Timeout during dSYM download. Try increasing :waitForDsymProcessingTimeout.")
|
104
|
-
end
|
105
|
-
|
106
|
-
dsym_paths += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS]
|
107
|
-
|
108
|
-
if dsym_paths.count > 0
|
109
|
-
UI.message "Downloaded the dSYMs from App Store Connect. Paths: #{dsym_paths}"
|
110
|
-
else
|
111
|
-
raise 'No dSYM paths found!'
|
112
|
-
end
|
113
|
-
else
|
114
|
-
UI.important "dSYM download disabled, using local path (#{params[:symbolsfile]})"
|
115
|
-
dsym_paths << params[:symbolsfile] if params[:symbolsfile]
|
116
|
-
end
|
117
|
-
|
118
|
-
# check if we have dSYMs to proceed with
|
119
|
-
if dsym_paths.count == 0
|
120
|
-
UI.message "Symbol file path: #{params[:symbolsfile]}"
|
121
|
-
dsym_paths = params[:symbolsfile]
|
122
|
-
symbolFilesCommandSnippet = "#{symbolFilesKey}=\"#{dsym_paths}\""
|
123
|
-
else
|
124
|
-
symbolFilesCommandSnippet = "#{symbolFilesKey}=\"#{dsym_paths[0]}\""
|
125
|
-
end
|
126
|
-
|
127
67
|
# start constructing the command that will trigger the DTXDssClient
|
128
68
|
command = []
|
129
69
|
command << "#{dtxDssClientPath}"
|
@@ -134,7 +74,7 @@ module Fastlane
|
|
134
74
|
command << "bundleId=\"#{bundleId}\""
|
135
75
|
command << "versionStr=\"#{params[:versionStr]}\""
|
136
76
|
command << "version=\"#{params[:version]}\""
|
137
|
-
command <<
|
77
|
+
command << "symbolsfile=\"#{params[:symbolsfile]}\""
|
138
78
|
command << "server=\"#{Helper::DynatraceHelper.without_trailing_slash(params[:server])}\""
|
139
79
|
command << "DTXLogLevel=ALL -verbose" if params[:debugMode] == true
|
140
80
|
command << "forced=1" # if the file already exists
|
@@ -143,7 +83,6 @@ module Fastlane
|
|
143
83
|
# Create the full shell command to trigger the DTXDssClient
|
144
84
|
shell_command = command.join(' ')
|
145
85
|
|
146
|
-
UI.message "dSYM path: #{dsym_paths[0]}"
|
147
86
|
UI.message "#{shell_command}"
|
148
87
|
|
149
88
|
sh("#{shell_command}", error_callback: ->(result) {
|
@@ -185,24 +124,6 @@ module Fastlane
|
|
185
124
|
UI.user_error!("Action needs to either be \"upload\" or \"decode\"") unless (value and value == "upload" or value == "decode")
|
186
125
|
end),
|
187
126
|
|
188
|
-
FastlaneCore::ConfigItem.new(key: :downloadDsyms,
|
189
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS",
|
190
|
-
default_value: false,
|
191
|
-
is_string: false,
|
192
|
-
description: "(iOS only) Download the dSYMs from App Store Connect"),
|
193
|
-
|
194
|
-
FastlaneCore::ConfigItem.new(key: :waitForDsymProcessing,
|
195
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_WAIT_PROCESSING",
|
196
|
-
default_value: true,
|
197
|
-
is_string: false,
|
198
|
-
description: "(iOS only) Wait for dSYM processing to be finished"),
|
199
|
-
|
200
|
-
FastlaneCore::ConfigItem.new(key: :waitForDsymProcessingTimeout,
|
201
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_WAIT_TIMEOUT",
|
202
|
-
default_value: 1800,
|
203
|
-
is_string: false,
|
204
|
-
description: "(iOS only) Timeout in seconds to wait for the dSYMs be downloadable"),
|
205
|
-
|
206
127
|
FastlaneCore::ConfigItem.new(key: :username,
|
207
128
|
env_name: "FL_UPLOAD_TO_DYNATRACE_DOWNLOAD_DSYMS_USERNAME",
|
208
129
|
description: "(iOS only) The username/AppleID to use to download the dSYMs"),
|
@@ -217,17 +138,12 @@ module Fastlane
|
|
217
138
|
end),
|
218
139
|
|
219
140
|
FastlaneCore::ConfigItem.new(key: :apitoken,
|
220
|
-
env_name: "
|
141
|
+
env_name: "FL_UPLOAD_TO_DYNATRACE_APITOKEN",
|
221
142
|
description: "Dynatrace API token with mobile symbolication permissions",
|
222
143
|
verify_block: proc do |value|
|
223
144
|
UI.user_error!("No Dynatrade API token for specified, pass using `apitoken: 'token'`") unless (value and not value.empty?)
|
224
145
|
end),
|
225
146
|
|
226
|
-
FastlaneCore::ConfigItem.new(key: :dtxDssClientPath,
|
227
|
-
env_name: "FL_UPLOAD_TO_DYNATRACE_DTXDssClientPath",
|
228
|
-
description: "(DEPRECATED) The path to your DTXDssClient. The DTXDssClient is downloaded and updated automatically, unless this key is set",
|
229
|
-
optional: true),
|
230
|
-
|
231
147
|
FastlaneCore::ConfigItem.new(key: :appId,
|
232
148
|
env_name: "FL_UPLOAD_TO_DYNATRACE_APP_ID",
|
233
149
|
description: "The app ID you get from your Dynatrace environment",
|
@@ -258,11 +174,17 @@ module Fastlane
|
|
258
174
|
|
259
175
|
FastlaneCore::ConfigItem.new(key: :symbolsfile,
|
260
176
|
env_name: "FL_UPLOAD_TO_DYNATRACE_SYM_FILE_PATH",
|
261
|
-
description: "Path to the dSYM file to be processed.
|
177
|
+
description: "Path to the dSYM or Android mapping file to be processed. Android only: If the file exceeds 10MiB and doesn't end with *.zip it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false",
|
262
178
|
verify_block: proc do |value|
|
263
179
|
UI.user_error!("Please provide a value for the symbol files. Pass using `symbolsfile: 'symbolsfile'`") unless (value and not value.empty?)
|
264
180
|
end),
|
265
181
|
|
182
|
+
FastlaneCore::ConfigItem.new(key: :symbolsfileAutoZip,
|
183
|
+
env_name: "FL_UPLOAD_TO_DYNATRACE_SYM_FILE_AUTO_ZIP",
|
184
|
+
default_value: true,
|
185
|
+
is_string: false,
|
186
|
+
description: "(Android only) Automatically zip symbolsfile if it exceeds 10MiB and doesn't already end with *.zip"),
|
187
|
+
|
266
188
|
FastlaneCore::ConfigItem.new(key: :server,
|
267
189
|
env_name: "FL_UPLOAD_TO_DYNATRACE_SERVER_URL",
|
268
190
|
description: "The API endpoint for the Dynatrace environment (e.g. https://environmentID.live.dynatrace.com or https://dynatrace-managed.com/e/environmentID)",
|
@@ -272,7 +194,7 @@ module Fastlane
|
|
272
194
|
|
273
195
|
FastlaneCore::ConfigItem.new(key: :cleanBuildArtifacts,
|
274
196
|
env_name: "FL_UPLOAD_TO_DYNATRACE_CLEAN_BUILD_ARTIFACTS",
|
275
|
-
default_value:
|
197
|
+
default_value: false,
|
276
198
|
is_string: false,
|
277
199
|
description: "Clean build artifacts after processing"),
|
278
200
|
|
@@ -3,6 +3,7 @@ require 'digest'
|
|
3
3
|
require 'net/http'
|
4
4
|
require 'tempfile'
|
5
5
|
require 'open-uri'
|
6
|
+
require 'zip'
|
6
7
|
|
7
8
|
module Fastlane
|
8
9
|
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
@@ -136,7 +137,7 @@ module Fastlane
|
|
136
137
|
end
|
137
138
|
end
|
138
139
|
|
139
|
-
def self.put_android_symbols(params, bundleId)
|
140
|
+
def self.put_android_symbols(params, bundleId, symbolspath)
|
140
141
|
path = "/api/config/v1/symfiles/#{params[:appId]}/#{bundleId}/ANDROID/#{params[:version]}/#{params[:versionStr]}"
|
141
142
|
|
142
143
|
# if path points to dynatrace managed, we need to prepend the path component from the server (/e/{your-environment-id})
|
@@ -148,14 +149,46 @@ module Fastlane
|
|
148
149
|
path = self.without_trailing_slash(uri[5]) + path
|
149
150
|
end
|
150
151
|
|
152
|
+
is_symbolsfile_zip = symbolspath.end_with?(".zip")
|
151
153
|
|
152
|
-
|
154
|
+
request = Net::HTTP::Put.new(path, initheader = { 'Content-Type' => is_symbolsfile_zip ? 'application/zip' : 'text/plain',
|
153
155
|
'Authorization' => "Api-Token #{params[:apitoken]}"} )
|
154
156
|
|
155
|
-
|
157
|
+
request.body = IO.read(symbolspath)
|
156
158
|
http = Net::HTTP.new(self.get_host_name(params), 443)
|
157
159
|
http.use_ssl = true
|
158
|
-
http.request(
|
160
|
+
response = http.request(request)
|
161
|
+
|
162
|
+
return [response, request]
|
163
|
+
end
|
164
|
+
|
165
|
+
def self.zip_if_required(params)
|
166
|
+
symbolsfile_path = params[:symbolsfile]
|
167
|
+
|
168
|
+
if !params[:symbolsfileAutoZip]
|
169
|
+
UI.message "Symbolsfile auto-zipping is disbled."
|
170
|
+
return symbolsfile_path
|
171
|
+
end
|
172
|
+
|
173
|
+
if symbolsfile_path.end_with?(".zip")
|
174
|
+
UI.message "Symbolsfile is already a zip."
|
175
|
+
return symbolsfile_path
|
176
|
+
end
|
177
|
+
|
178
|
+
if File.size(symbolsfile_path) > 10 * 1024 * 1024 # 10MiB
|
179
|
+
symbolsfile_path_zip = symbolsfile_path + ".zip"
|
180
|
+
UI.message "Symbolsfile exceeds 10MiB -> zipping to " + symbolsfile_path_zip
|
181
|
+
|
182
|
+
# replace any old file
|
183
|
+
FileUtils.rm_f(symbolsfile_path_zip)
|
184
|
+
|
185
|
+
Zip::File.open(symbolsfile_path_zip, create: true) do |zipfile|
|
186
|
+
zipfile.add(File.basename(symbolsfile_path), symbolsfile_path)
|
187
|
+
end
|
188
|
+
symbolsfile_path = symbolsfile_path_zip
|
189
|
+
end
|
190
|
+
|
191
|
+
return symbolsfile_path
|
159
192
|
end
|
160
193
|
|
161
194
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-dynatrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dynatrace LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -136,6 +136,104 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 2.142.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubyzip
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: digest
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: net-http
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: tempfile
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: open-uri
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: os
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: json
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
139
237
|
description:
|
140
238
|
email: mobile.agent@dynatrace.com
|
141
239
|
executables: []
|
@@ -150,7 +248,7 @@ files:
|
|
150
248
|
- lib/fastlane/plugin/dynatrace/version.rb
|
151
249
|
homepage: https://github.com/Dynatrace/fastlane-plugin-dynatrace
|
152
250
|
licenses:
|
153
|
-
-
|
251
|
+
- Apache 2.0
|
154
252
|
metadata: {}
|
155
253
|
post_install_message:
|
156
254
|
rdoc_options: []
|
@@ -167,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
265
|
- !ruby/object:Gem::Version
|
168
266
|
version: '0'
|
169
267
|
requirements: []
|
170
|
-
rubygems_version: 3.3.
|
268
|
+
rubygems_version: 3.3.11
|
171
269
|
signing_key:
|
172
270
|
specification_version: 4
|
173
271
|
summary: This action processes and uploads your symbol files to Dynatrace
|