fastlane-plugin-dynatrace 1.0.2 → 1.0.3

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: 920b0c5553ebb02953f85441f6ab8a4bba712003435f354e3f11458c0c23f7f9
4
- data.tar.gz: 64d293694d00bd694df462fbd5ee5e16ed12359c93e18817e9bf9fe8a92f9c5d
3
+ metadata.gz: e893f895c684763a074f06dfa448156b4f4bdf639f7d287e409cd09c437a1709
4
+ data.tar.gz: c758ebf1327254eed71f2b138efe9b50b9058a38a3e2a235411fcbeb06fcefb2
5
5
  SHA512:
6
- metadata.gz: 9be84816a06cf7df02d04d625c7b982e317a7b23a62f839de9cb1600c18ea08779c7f5d23d71de5cf802d507240c7826c61dd4daa07dd939f6e41cad9ad656ac
7
- data.tar.gz: d452461f103ff34d7b290cd5a1bd3f4e988c01956779707cc5166572665101c817a3f880865d5ead209a547864b3a2e894875aa93e03cccdb4c3010748e560f4
6
+ metadata.gz: 3ba82e96e1e13c05504f5f732f7313ad10b743664da56f7198d4e5701e278c92a6fb4512088419200fede8b6e596f447a3ebccf921356a072fd067a2c333a978
7
+ data.tar.gz: 3f752665d4a5128e32d8340b795ce5ab323b97ae4314619f4d0f78d9482c572a273aa677db50cd6fc2786c35be1731a51e9cc330c33a09706bab22dfeba042dc
@@ -40,7 +40,10 @@ module Fastlane
40
40
  when '413'
41
41
  UI.user_error! "Failed to upload. 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."
42
42
  else
43
- message = JSON.parse(response.body)["error"]["message"]
43
+ message = nil
44
+ unless response.body.nil?
45
+ message = JSON.parse(response.body)["error"]["message"]
46
+ end
44
47
  if message.nil?
45
48
  UI.user_error! "Symbol upload error (Response Code: #{response.code}). Please try again in a few minutes or contact the Dynatrace support (https://www.dynatrace.com/services-support/)."
46
49
  else
@@ -131,7 +134,7 @@ module Fastlane
131
134
  command << "versionStr=\"#{params[:versionStr]}\""
132
135
  command << "version=\"#{params[:version]}\""
133
136
  command << symbolFilesCommandSnippet
134
- command << "server=\"#{Helper::DynatraceHelper.get_base_url(params)}\""
137
+ command << "server=\"#{Helper::DynatraceHelper.without_trailing_slash(params[:server])}\""
135
138
  command << "DTXLogLevel=ALL -verbose" if params[:debugMode] == true
136
139
  command << "forced=1" # if the file already exists
137
140
 
@@ -21,7 +21,7 @@ module Fastlane
21
21
  end
22
22
 
23
23
  # get latest version info
24
- clientUri = URI("#{self.get_base_url(params)}/api/config/v1/symfiles/dtxdss-download?Api-Token=#{params[:apitoken]}")
24
+ clientUri = URI("#{self.without_trailing_slash(params[:server])}/api/config/v1/symfiles/dtxdss-download?Api-Token=#{params[:apitoken]}")
25
25
  response = Net::HTTP.get_response(clientUri)
26
26
 
27
27
  # filter any http errors
@@ -113,9 +113,12 @@ module Fastlane
113
113
  return dtxDssClientPath
114
114
  end
115
115
 
116
- def self.get_base_url(params)
117
- uri = URI.split(params[:server])
118
- return uri[0] + '://' + uri[2]
116
+ def self.without_trailing_slash(server)
117
+ if server[-1] == '/'
118
+ return server[0..-2]
119
+ else
120
+ return server
121
+ end
119
122
  end
120
123
 
121
124
  def self.get_host_name(params)
@@ -136,6 +139,16 @@ module Fastlane
136
139
  def self.put_android_symbols(params, bundleId)
137
140
  path = "/api/config/v1/symfiles/#{params[:appId]}/#{bundleId}/ANDROID/#{params[:version]}/#{params[:versionStr]}"
138
141
 
142
+ # if path points to dynatrace managed, we need to prepend the path component from the server (/e/{your-environment-id})
143
+ if params[:server].include? '/e/'
144
+ uri = URI.split(params[:server])
145
+ if uri[5].nil?
146
+ UI.user_error! "The path component of your managed Dynatrace URL is empty. Does the server URL follow the correct pattern (https://{your-domain}/e/{your-environment-id})?"
147
+ end
148
+ path = self.without_trailing_slash(uri[5]) + path
149
+ end
150
+
151
+
139
152
  req = Net::HTTP::Put.new(path, initheader = { 'Content-Type' => 'text/plain',
140
153
  'Authorization' => "Api-Token #{params[:apitoken]}"} )
141
154
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Dynatrace
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
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: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynatrace LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry