fastlane-plugin-apptics 1.0.0 → 1.0.2
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: 43a74d0a2389519e0ee30b3bf62cc3af5173b4a685415ab2f513be754c433370
|
4
|
+
data.tar.gz: e1603f1d1e0d00e54b8d5a5adcf8a025f2ea68611f4546e60030103d753d9fb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed606bc65f8aa4784bab0d379ff31a4537ae3f25906e223a68f94a347e7300725313e8c66f8f57529999ac13d75ae8f73d219836e01b530bec2f9f479bb67861
|
7
|
+
data.tar.gz: 486d02dee328bda38c83901e54b095f46e915afb3a9685e9ca2691f40d595168b3b8b79a156c4dfb04aaf6504af232ca077737c1f13e2a3dc6fdb906bb22d3fc
|
@@ -0,0 +1,167 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE = :UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE
|
5
|
+
end
|
6
|
+
|
7
|
+
class UploadDsymToAppticsAction < Action
|
8
|
+
|
9
|
+
def self.run(params)
|
10
|
+
|
11
|
+
if params[:APP_VERSION] && params[:BUILD_VERSION] && params[:DSYM_FILE_PATH] && options_from_info_plist(params[:CONFIG_FILE_PATH]) != nil
|
12
|
+
|
13
|
+
dsym_zip_file = params[:DSYM_FILE_PATH]
|
14
|
+
app_version = params[:APP_VERSION]
|
15
|
+
build_version = params[:BUILD_VERSION]
|
16
|
+
config_file = options_from_info_plist(params[:CONFIG_FILE_PATH])
|
17
|
+
upload(config_file, dsym_zip_file,app_version,build_version)
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
def self.valid_json?(string)
|
22
|
+
!!JSON.parse(string)
|
23
|
+
rescue JSON::ParserError
|
24
|
+
false
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.upload(apptics_config, dsym_zip_file,app_version,build_version)
|
28
|
+
api_key = apptics_config[:API_KEY]
|
29
|
+
server_url = apptics_config[:SERVER_URL]
|
30
|
+
bundle_id = apptics_config[:BUNDLE_ID]
|
31
|
+
puts"dsym_zip_file #{dsym_zip_file}"
|
32
|
+
puts "api_key #{api_key}"
|
33
|
+
server_url = "#{server_url}/api/janalytic/v3/addDsymfile?mode=1&platform=iOS&identifier=#{bundle_id}&appversion=#{app_version}&host=macbuild&remoteaddress=192.168.113.85&buildversion=#{build_version}&minosversion=10.13&frameworkversion=1.2.1"
|
34
|
+
|
35
|
+
|
36
|
+
puts "server_url #{server_url}"
|
37
|
+
|
38
|
+
url = URI.parse(server_url)
|
39
|
+
File.open(dsym_zip_file) do |zip|
|
40
|
+
req = Net::HTTP::Post.new(url)
|
41
|
+
form_data = [['dsymfile', zip]]
|
42
|
+
req.set_form form_data, 'multipart/form-data'
|
43
|
+
req['zak']=api_key
|
44
|
+
res = Net::HTTP.start(url.host, url.port, use_ssl: true, open_timeout:60, read_timeout: 300) do |http|
|
45
|
+
http.request(req)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Status
|
49
|
+
puts res.code # => '200'
|
50
|
+
puts res.class.name # => 'HTTPOK'
|
51
|
+
puts res.body
|
52
|
+
# Body
|
53
|
+
if valid_json?(res.body)
|
54
|
+
data_hash = JSON.parse(res.body)
|
55
|
+
puts "dSYM upload status : #{data_hash['result']}"
|
56
|
+
if data_hash["result"] == "success"
|
57
|
+
puts "data : #{data_hash['data']}"
|
58
|
+
else
|
59
|
+
puts "error_message : #{data_hash['error_message']}"
|
60
|
+
end
|
61
|
+
else
|
62
|
+
puts res.body
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
#####################################################
|
68
|
+
# @!group Documentation
|
69
|
+
#####################################################
|
70
|
+
|
71
|
+
def self.description
|
72
|
+
"A short description with <= 80 characters of what this action does"
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.details
|
76
|
+
# Optional:
|
77
|
+
# this is your chance to provide a more detailed description of this action
|
78
|
+
"You can use this action to do cool things..."
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.available_options
|
82
|
+
# Define all options your action supports.
|
83
|
+
|
84
|
+
# Below a few examples
|
85
|
+
[
|
86
|
+
FastlaneCore::ConfigItem.new(key: :APP_VERSION,
|
87
|
+
env_name: "APP_VERSION", # The name of the environment variable
|
88
|
+
description: "App Version Token for UploadDsymToAppticsAction", # a short description of this parameter
|
89
|
+
verify_block: proc do |value|
|
90
|
+
UI.user_error!("No App Version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
|
91
|
+
end),
|
92
|
+
|
93
|
+
FastlaneCore::ConfigItem.new(key: :DSYM_FILE_PATH,
|
94
|
+
env_name: "DSYM_FILE_PATH", # The name of the environment variable
|
95
|
+
description: "API Token for UploadDsymToAppticsAction", # a short description of this parameter
|
96
|
+
verify_block: proc do |value|
|
97
|
+
UI.user_error!("No API token for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
|
98
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
99
|
+
end),
|
100
|
+
|
101
|
+
FastlaneCore::ConfigItem.new(key: :BUILD_VERSION,
|
102
|
+
env_name: "BUILD_VERSION]", # The name of the environment variable
|
103
|
+
description: "Build version for UploadDsymToAppticsAction", # a short description of this parameter
|
104
|
+
verify_block: proc do |value|
|
105
|
+
UI.user_error!("No Build version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
|
106
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
107
|
+
end),
|
108
|
+
|
109
|
+
FastlaneCore::ConfigItem.new(key: :CONFIG_FILE_PATH,
|
110
|
+
env_name: "CONFIG_FILE_PATH", # The name of the environment variable
|
111
|
+
description: "Config File for UploadDsymToAppticsAction", # a short description of this parameter
|
112
|
+
verify_block: proc do |value|
|
113
|
+
UI.user_error!("No Config File for UploadDsymToAppticsAction given") unless (value and not value.empty?)
|
114
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
115
|
+
end)
|
116
|
+
]
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.output
|
120
|
+
# Define the shared values you are going to provide
|
121
|
+
# Example
|
122
|
+
[
|
123
|
+
['UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE', 'A description of what this value contains']
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.options_from_info_plist file_path
|
128
|
+
|
129
|
+
plist_getter = Fastlane::Actions::GetInfoPlistValueAction
|
130
|
+
api_key = plist_getter.run(path: file_path, key: "API_KEY")
|
131
|
+
server_url = plist_getter.run(path: file_path, key: "SERVER_URL")
|
132
|
+
app_version_meta = plist_getter.run(path: file_path, key: "APP_VERSION_META")
|
133
|
+
bundle_id = plist_getter.run(path: file_path, key: "BUNDLE_ID")
|
134
|
+
|
135
|
+
{
|
136
|
+
API_KEY: api_key,
|
137
|
+
SERVER_URL:server_url,
|
138
|
+
BUNDLE_ID:bundle_id,
|
139
|
+
APP_VERSION_META: app_version_meta
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
def self.return_value
|
148
|
+
# If your method provides a return value, you can describe here what it does
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.authors
|
152
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
153
|
+
["Your GitHub/Twitter Name"]
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.is_supported?(platform)
|
157
|
+
[:ios, :mac, :tvos].include?(platform)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
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.
|
4
|
+
version: 1.0.2
|
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-
|
11
|
+
date: 2022-05-16 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
|