fastlane-plugin-apptics 1.0.0 → 1.2.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: 517357d48d51ee35d77c5938a30e1103919b4963272ae13770afcf0d7e8fe54d
4
- data.tar.gz: fe5e9933c71ec17492aceecd6bb9311425994fe6cfd2bd302147384a5981f0d0
3
+ metadata.gz: aa259a1c4e1b532215918d77e3da9ccad853b81f2b751568aface03c155572df
4
+ data.tar.gz: ea2fe2ffeeb553eace9008f1dd88540499250caf4c3a9e219f6b4bcaa9d467d9
5
5
  SHA512:
6
- metadata.gz: f01c30cd0fc65e188aeea91f5b43e54caf593b9cd38fbe6fde1a1971662bdcc52e552c4dbf940946efc014a2fb1dd9180e1e647814ca46c52b97dc58e0b2a351
7
- data.tar.gz: abb43153a5a29af8eaffa50bda9d4ee67cada363dc677ed3b6b651822c960b5866f6405efd6403230801966357c660e439810100c55144020d2863888e8a51a9
6
+ metadata.gz: 5deb9dbcf9b4ba39b260c6b2e3fc47687049fda5cfa20d0896ad8ca96c65ca3201914f3e4dc937c830856ce96181da38582079b12884cce899f050da972169f4
7
+ data.tar.gz: 3876dd67e6da6dcd8725f701675c3766037cd358c448286ee79b7777550778efeccf023dabf3142f1e7a838d582fb67bdfd3c94f1b3c938b5e379f08168d9c5d
@@ -0,0 +1,216 @@
1
+
2
+
3
+ module Fastlane
4
+ module Actions
5
+ module SharedValues
6
+ UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE = :UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE
7
+ end
8
+
9
+ class UploadDsymToAppticsAction < Action
10
+
11
+ def self.run(params)
12
+
13
+ if params[:appversion] && params[:modevalue] && params[:platformvalue] && params[:bundleid] && params[:buildversion] && params[:dsymfilepath] && options_from_info_plist(params[:configfilepath]) != nil
14
+ dsym_zip_file = params[:dsymfilepath]
15
+ app_version = params[:appversion]
16
+ build_version = params[:buildversion]
17
+ mode_value = params[:modevalue]
18
+ platform_value = params[:platformvalue]
19
+ bundleid = params[:bundleid]
20
+ config_file = options_from_info_plist(params[:configfilepath])
21
+ upload(config_file, dsym_zip_file,app_version,build_version,mode_value,platform_value,bundleid)
22
+
23
+ end
24
+ end
25
+ def self.valid_json?(string)
26
+ !!JSON.parse(string)
27
+ rescue JSON::ParserError
28
+ false
29
+ end
30
+
31
+ def self.upload(apptics_config, dsym_zip_file,app_version,build_version,mode_value,platform_value,bundleid)
32
+ api_key = apptics_config[:API_KEY]
33
+ server_url = apptics_config[:SERVER_URL]
34
+ bundle_id = apptics_config[:BUNDLE_ID]
35
+
36
+ puts "bundleid #{bundleid}"
37
+ puts "mode_value #{mode_value}"
38
+ puts "platform_value #{platform_value}"
39
+ #check mode value empty or nil
40
+ if mode_value.nil? || mode_value.empty?
41
+ puts "mode_value is empty or nil "
42
+ mode_value = 1
43
+ else
44
+ puts "mode_value is not empty"
45
+ end
46
+ #check platform value empty or nil
47
+
48
+ if platform_value.nil? || platform_value.empty?
49
+ puts "platform_value is empty or nil "
50
+ platform_value = 'iOS'
51
+
52
+ else
53
+ puts "platform_value is not empty"
54
+ end
55
+ #check bundleid from config file is equals to the fastfile bundleid
56
+
57
+ if bundleid == bundle_id
58
+ else
59
+ UI.error "ABORTED! BUNDLE_ID mismatch replace #{bundle_id} to #{bundleid} "
60
+ exit(true)
61
+ end
62
+ puts "mode_value #{mode_value}"
63
+ puts"dsym_zip_file #{dsym_zip_file}"
64
+ puts "api_key #{api_key}"
65
+
66
+ server_url = "#{server_url}/api/janalytic/v3/addDsymfile?mode=#{mode_value}&platform=#{platform_value}&identifier=#{bundle_id}&appversion=#{app_version}&host=&remoteaddress=&buildversion=#{build_version}&minosversion=&frameworkversion=#{Apptics::VERSION}"
67
+
68
+
69
+ puts "server_url #{server_url}"
70
+
71
+ url = URI.parse(server_url)
72
+ File.open(dsym_zip_file) do |zip|
73
+ req = Net::HTTP::Post.new(url)
74
+ form_data = [['dsymfile', zip]]
75
+ req.set_form form_data, 'multipart/form-data'
76
+ req['zak']=api_key
77
+ res = Net::HTTP.start(url.host, url.port, use_ssl: true, open_timeout:60, read_timeout: 300) do |http|
78
+ http.request(req)
79
+ end
80
+
81
+ # Status
82
+ puts res.code # => '200'
83
+ puts res.class.name # => 'HTTPOK'
84
+ puts res.body
85
+ # Body
86
+ if valid_json?(res.body)
87
+ data_hash = JSON.parse(res.body)
88
+ puts "dSYM upload status : #{data_hash['result']}"
89
+ if data_hash["result"] == "success"
90
+ puts "data : #{data_hash['data']}"
91
+ else
92
+ puts "error_message : #{data_hash['error_message']}"
93
+ end
94
+ else
95
+ puts res.body
96
+ end
97
+ end
98
+ end
99
+
100
+ #####################################################
101
+ # @!group Documentation
102
+ #####################################################
103
+
104
+ def self.description
105
+ "A short description with <= 80 characters of what this action does"
106
+ end
107
+
108
+ def self.details
109
+ # Optional:
110
+ # this is your chance to provide a more detailed description of this action
111
+ "You can use this action to do cool things..."
112
+ end
113
+
114
+ def self.available_options
115
+ # Define all options your action supports.
116
+
117
+ # Below a few examples
118
+ [
119
+ FastlaneCore::ConfigItem.new(key: :appversion,
120
+ env_name: "appversion", # The name of the environment variable
121
+ description: "App Version Token for UploadDsymToAppticsAction", # a short description of this parameter
122
+ verify_block: proc do |value|
123
+ UI.user_error!("No App Version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
124
+ end),
125
+
126
+ FastlaneCore::ConfigItem.new(key: :dsymfilepath,
127
+ env_name: "dsymfilepath", # The name of the environment variable
128
+ description: "API Token for UploadDsymToAppticsAction", # a short description of this parameter
129
+ verify_block: proc do |value|
130
+ UI.user_error!("No API token for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
131
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
132
+ end),
133
+ FastlaneCore::ConfigItem.new(key: :modevalue,
134
+ env_name: "modevalue", # The name of the environment variable
135
+ description: "mode for UploadDsymToAppticsAction", # a short description of this parameter
136
+ verify_block: proc do |value|
137
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
138
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
139
+ end),
140
+ FastlaneCore::ConfigItem.new(key: :platformvalue,
141
+ env_name: "platformvalue", # The name of the environment variable
142
+ description: "platform for UploadDsymToAppticsAction", # a short description of this parameter
143
+ verify_block: proc do |value|
144
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
145
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
146
+ end),
147
+ FastlaneCore::ConfigItem.new(key: :bundleid,
148
+ env_name: "bundleid", # The name of the environment variable
149
+ description: "bundleid for UploadDsymToAppticsAction", # a short description of this parameter
150
+ verify_block: proc do |value|
151
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
152
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
153
+ end),
154
+
155
+ FastlaneCore::ConfigItem.new(key: :buildversion,
156
+ env_name: "buildversion]", # The name of the environment variable
157
+ description: "Build version for UploadDsymToAppticsAction", # a short description of this parameter
158
+ verify_block: proc do |value|
159
+ UI.user_error!("No Build version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
160
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
161
+ end),
162
+
163
+ FastlaneCore::ConfigItem.new(key: :configfilepath,
164
+ env_name: "configfilepath", # The name of the environment variable
165
+ description: "Config File for UploadDsymToAppticsAction", # a short description of this parameter
166
+ verify_block: proc do |value|
167
+ UI.user_error!("No Config File for UploadDsymToAppticsAction given") unless (value and not value.empty?)
168
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
169
+ end)
170
+
171
+ ]
172
+ end
173
+
174
+ def self.output
175
+ # Define the shared values you are going to provide
176
+ # Example
177
+ [
178
+ ['UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE', 'A description of what this value contains']
179
+ ]
180
+ end
181
+
182
+ def self.options_from_info_plist file_path
183
+
184
+ plist_getter = Fastlane::Actions::GetInfoPlistValueAction
185
+ api_key = plist_getter.run(path: file_path, key: "API_KEY")
186
+ server_url = plist_getter.run(path: file_path, key: "SERVER_URL")
187
+ app_version_meta = plist_getter.run(path: file_path, key: "APP_VERSION_META")
188
+ bundle_id = plist_getter.run(path: file_path, key: "BUNDLE_ID")
189
+
190
+ {
191
+ API_KEY: api_key,
192
+ SERVER_URL:server_url,
193
+ BUNDLE_ID:bundle_id,
194
+ APP_VERSION_META: app_version_meta
195
+ }
196
+
197
+
198
+ end
199
+
200
+
201
+
202
+ def self.return_value
203
+ # If your method provides a return value, you can describe here what it does
204
+ end
205
+
206
+ def self.authors
207
+ # So no one will ever forget your contribution to fastlane :) You are awesome btw!
208
+ ["Your GitHub/Twitter Name"]
209
+ end
210
+
211
+ def self.is_supported?(platform)
212
+ [:ios, :mac, :tvos].include?(platform)
213
+ end
214
+ end
215
+ end
216
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Apptics
3
- VERSION = "1.0.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-apptics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaikarthick R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-12 00:00:00.000000000 Z
11
+ date: 2022-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,6 +160,7 @@ files:
160
160
  - README.md
161
161
  - lib/fastlane/plugin/apptics.rb
162
162
  - lib/fastlane/plugin/apptics/actions/apptics_action.rb
163
+ - lib/fastlane/plugin/apptics/actions/upload_dsym_to_apptics.rb
163
164
  - lib/fastlane/plugin/apptics/helper/apptics_helper.rb
164
165
  - lib/fastlane/plugin/apptics/version.rb
165
166
  homepage: https://github.com/zoho/fastlane-plugin-apptics