Class: Pindo::TaskSystem::JPSUploadTask
- Defined in:
- lib/pindo/module/task/model/jps/jps_upload_task.rb
Overview
JPS 上传任务上传构建产物到 JPS 测试平台
Instance Attribute Summary collapse
-
#file_type ⇒ Object
readonly
Returns the value of attribute file_type.
-
#upload_file ⇒ Object
readonly
Returns the value of attribute upload_file.
-
#upload_path ⇒ Object
readonly
Returns the value of attribute upload_path.
Attributes inherited from JPSTask
#app_info_obj, #project_name, #workflow_info
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #data_dependencies, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #started_at, #status, #task_key, #task_manager, #type
Class Method Summary collapse
-
.task_key ⇒ Object
任务键.
Instance Method Summary collapse
-
#initialize(file_type, upload_path, upload_file, options = {}) ⇒ JPSUploadTask
constructor
初始化上传任务.
- #validate ⇒ Object
Methods inherited from JPSTask
default_retry_count, default_retry_delay, default_retry_mode, task_type, task_type_name
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #data_param, default_retry_count, default_retry_delay, default_retry_mode, #do_task, #execution_time, #finished?, #get_all_data_params, #get_all_data_params_by_key, #get_all_dependencies_results, #get_data_param, #get_data_param_by_key, #get_dependency_result, #get_dependency_task, #on, #primary_data_param, #reset_for_retry, #retryable?, #running?, #should_retry?, task_type
Constructor Details
#initialize(file_type, upload_path, upload_file, options = {}) ⇒ JPSUploadTask
初始化上传任务
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 26 def initialize(file_type, upload_path, upload_file, = {}) @file_type = file_type # 'ipa' | 'apk' | 'html' | 'app' @upload_path = upload_path # 搜索文件的路径 @upload_file = upload_file # 要上传的文件(nil 表示自动查找) @upload_desc = [:upload_desc] # 上传描述 # 设置上传任务的优先级为 LOW,确保在构建任务之后执行 [:priority] ||= TaskPriority::LOW name = case file_type when 'ipa' "上传 IPA" when 'apk' "上传 APK" when 'html' "上传 WebGL" when 'app' "上传 macOS App" else "上传 #{file_type.upcase}" end super(name, ) end |
Instance Attribute Details
#file_type ⇒ Object (readonly)
Returns the value of attribute file_type.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 10 def file_type @file_type end |
#upload_file ⇒ Object (readonly)
Returns the value of attribute upload_file.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 10 def upload_file @upload_file end |
#upload_path ⇒ Object (readonly)
Returns the value of attribute upload_path.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 10 def upload_path @upload_path end |
Class Method Details
.task_key ⇒ Object
任务键
13 14 15 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 13 def self.task_key :jps_upload end |
Instance Method Details
#validate ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/pindo/module/task/model/jps/jps_upload_task.rb', line 51 def validate # 验证基本参数 unless @file_type && !@file_type.empty? @error = "缺少必需参数: file_type" return false end unless @upload_path && !@upload_path.empty? @error = "缺少必需参数: upload_path" return false end # upload_path 可能在构建任务执行后才创建,这里不验证是否存在 # 实际文件查找会在 do_work 中进行 # app_info_obj 和 workflow_info 可以延迟获取,不在这里验证 true end |