fastlane-plugin-apptics 0.1.0 → 1.1.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: 8822fe5165d9de97411c4b66717cd05a22e1d4373fec0885bf83ec2236903e54
4
- data.tar.gz: 3578b3d09ccdddb3d6e145802035aff58aa294a31c24530647d61ac3e3d52b2e
3
+ metadata.gz: fd305ff780b399f51584bfd1c7d70546aae0b69304b2561dee3e98a93d537936
4
+ data.tar.gz: 2a70a81e4294a45490227ae251b461ce038da02c17851cf7943b0a417fd7eac8
5
5
  SHA512:
6
- metadata.gz: eabb6a6f4aae8e4d602cb6576fc4c4123d235df59085534c51e394e98de297037a75053c6aec7faa8183f31bbc887cdfb4e5b768e4d8239deb92d89d54ecdfc1
7
- data.tar.gz: cbcdc2df124d423f75b6422a41800577ea1fdfa7a2e48c149853ca9196550c966ebf0f2ca561618be9f6d71ef7eb849bc51849f37074402e7dc59f57530fe387
6
+ metadata.gz: fbfedb73529cfad37e8224a6b8a8fa13631e72bf6d8b4534c6d897452c45abb4be87cf51913f939f5d3148679fcf6a76c21c5ea0e86ea1624c0881154952681b
7
+ data.tar.gz: 49205174044a27184d4bfbcdea05df6158452dfcb0e4450ca02baf82100d4e04be8d242ab7824ee841185d3dec8001eb3426ad7ba677d8aefee2850f3e10fcc7
@@ -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[:APP_VERSION] && params[:MODE_VALUE] && params[:PLATFORM_VALUE] && params[:BUNDLE_ID] && params[:BUILD_VERSION] && params[:DSYM_FILE_PATH] && options_from_info_plist(params[:CONFIG_FILE_PATH]) != nil
14
+ dsym_zip_file = params[:DSYM_FILE_PATH]
15
+ app_version = params[:APP_VERSION]
16
+ build_version = params[:BUILD_VERSION]
17
+ mode_value = params[:MODE_VALUE]
18
+ platform_value = params[:PLATFORM_VALUE]
19
+ bundleid = params[:BUNDLE_ID]
20
+ config_file = options_from_info_plist(params[:CONFIG_FILE_PATH])
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: :APP_VERSION,
120
+ env_name: "APP_VERSION", # The name of the environment variable
121
+ description: "App Version needed 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: :DSYM_FILE_PATH,
127
+ env_name: "DSYM_FILE_PATH", # The name of the environment variable
128
+ description: "DSYM path for UploadDsymToAppticsAction", # a short description of this parameter
129
+ verify_block: proc do |value|
130
+ UI.user_error!("No DSYM path 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: :MODE_VALUE,
134
+ env_name: "MODE_VALUE", # 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: :PLATFORM_VALUE,
141
+ env_name: "PLATFORM_VALUE", # 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: :BUNDLE_ID,
148
+ env_name: "BUNDLE_ID", # 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: :BUILD_VERSION,
156
+ env_name: "BUILD_VERSION]", # 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: :CONFIG_FILE_PATH,
164
+ env_name: "CONFIG_FILE_PATH", # 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 = "0.1.0"
3
+ VERSION = "1.1.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: 0.1.0
4
+ version: 1.1.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-19 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