Class: Fastlane::Actions::ZealotDebugFileAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ZealotDebugFileAction
- Extended by:
- Helper::ZealotHelper
- Defined in:
- lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb
Constant Summary collapse
- PLATFORM =
%I[ios mac macos osx android].freeze
Constants included from Helper::ZealotHelper
Helper::ZealotHelper::UPLOAD_APP_PARAMS_KEYS
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .example_code ⇒ Object
- .is_supported?(_) ⇒ Boolean
- .output ⇒ Object
Class Method Summary collapse
- .generate_dsym_zip(params, path) ⇒ Object
- .generate_proguard_zip(params, path) ⇒ Object
- .generate_zip_file(params) ⇒ Object
- .run(params) ⇒ Object
Methods included from Helper::ZealotHelper
avialable_upload_app_params, build_app_version_check_params, build_table_data, check_app_version, detect_ci_url, detect_source, gitlab?, hidden_keys, http_request, jenkins?, make_connection, print_table, show_error, sync_deivce, upload_app, upload_app_params, upload_debug_file, upload_debug_file_params
Class Method Details
.authors ⇒ Object
197 198 199 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 197 def self. ['icyleaf'] end |
.available_options ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 81 def self. [ FastlaneCore::ConfigItem.new(key: :endpoint, env_name: 'ZEALOT_ENDPOINT', description: 'The endpoint of zealot', type: String), FastlaneCore::ConfigItem.new(key: :token, env_name: 'ZEALOT_TOKEN', description: 'The token of user', sensitive: true, verify_block: proc do |value| UI.user_error!("No user token for Zealot given, pass using `token: 'token'`") if value.nil? || value.empty? end, type: String), FastlaneCore::ConfigItem.new(key: :channel_key, env_name: 'ZEALOT_CHANNEL_KEY', description: 'The key of app\'s channel', type: String), FastlaneCore::ConfigItem.new(key: :platform, env_name: 'ZEALOT_PLATFORM', description: "The name of platfrom, avaiable value are #{PLATFORM.join(',')}", verify_block: proc do |value| UI.user_error!("No match value of platform: #{value}") unless PLATFORM.include?(value) end, type: :Symbol), FastlaneCore::ConfigItem.new(key: :path, env_name: 'ZEALOT_PATH', description: 'The path of debug file (iOS/macOS is archive path for Xcode, Android is path for app project)', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :xcode_scheme, env_name: 'ZEALOT_XCODE_SCHEME', description: 'The scheme name of app', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :android_build_type, env_name: 'ZEALOT_ANDROID_BUILD_TYPE', description: 'The build type of app', default_value: Fastlane::Actions::ProguardAction::RELEASE_TYPE, optional: true, type: String), FastlaneCore::ConfigItem.new(key: :android_flavor, env_name: 'ZEALOT_ANDROID_FLAVOR', description: 'The product flavor of app', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :extra_files, env_name: 'ZEALOT_EXTRA_FILES', description: 'A set file names', optional: true, default_value: [], type: Array), FastlaneCore::ConfigItem.new(key: :output_path, env_name: 'DF_DSYM_OUTPUT_PATH', description: "The output path of compressed dSYM file", default_value: '.', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :release_version, env_name: 'ZEALOT_RELEASE_VERSION', description: 'The release version of app', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :build_version, env_name: 'ZEALOT_BUILD_VERSION', description: 'The build version of app', optional: true, type: String), FastlaneCore::ConfigItem.new(key: :overwrite, env_name: 'DF_DSYM_OVERWRITE', description: "Overwrite output compressed file if it existed", default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :timeout, env_name: 'ZEALOT_TIMEOUT', description: 'Request timeout in seconds', type: Integer, optional: true), FastlaneCore::ConfigItem.new(key: :verify_ssl, env_name: 'ZEALOT_VERIFY_SSL', description: 'Should verify SSL of zealot service', optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :fail_on_error, env_name: 'ZEALOT_FAIL_ON_ERROR', description: 'Should an error uploading app cause a failure? (true/false)', optional: true, default_value: false, type: Boolean) ] end |
.category ⇒ Object
193 194 195 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 193 def self.category :misc end |
.description ⇒ Object
77 78 79 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 77 def self.description 'Upload a new build to Zealot' end |
.example_code ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 174 def self.example_code [ 'zealot_debug_file( endpoint: "...", token: "...", channel_key: "...", zip_file: "...", release_version: "...", build_version: "..." )' ] end |
.generate_dsym_zip(params, path) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 43 def self.generate_dsym_zip(params, path) params[:archive_path] = if path path else Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] || Fastlane::Actions::DsymAction::ARCHIVE_PATH end params[:scheme] = params.delete(:xcode_scheme) Fastlane::Actions::DsymAction.run(params) end |
.generate_proguard_zip(params, path) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 54 def self.generate_proguard_zip(params, path) params[:app_path] = path if path && !path.empty? params[:build_type] = params.delete(:android_build_type) params[:flavor] = params.delete(:android_flavor) Fastlane::Actions::ProguardAction.run(params) end |
.generate_zip_file(params) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 25 def self.generate_zip_file(params) new_params = params.all_keys.each_with_object({}) do |key, obj| next unless value = params[key] obj[key] = value end path = new_params.delete(:path) platform = new_params[:platform] case platform when :ios, :mac, :macos, :osx generate_dsym_zip(new_params, path) when :android generate_proguard_zip(new_params, path) else UI.user_error!("No match value of platform: #{value}, avaiable value are #{PLATFORM.join(',')}.") end end |
.is_supported?(_) ⇒ Boolean
201 202 203 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 201 def self.is_supported?(_) true end |
.output ⇒ Object
187 188 189 190 191 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 187 def self.output [ ['ZEAALOT_ERROR_MESSAGE', 'The error message during upload process'] ] end |
.run(params) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/zealot/actions/zealot_debug_file.rb', line 15 def self.run(params) file = generate_zip_file(params) UI.user_error! "Something wrong with compress debug file" unless file response = upload_debug_file(params, file) if parse_response(response, params[:endpoint], params[:fail_on_error]) UI.success('Build successfully uploaded to Zealot.') end end |