Class: Pindo::TaskSystem::GitCommitTask
- Defined in:
- lib/pindo/module/task/model/git/git_commit_task.rb
Overview
Git 提交任务负责检查并提交仓库的未提交修改
Instance Attribute Summary
Attributes inherited from GitTask
#build_number, #build_version, #commit_hash, #git_root_path, #project_path, #release_branch, #tag_pre, #tag_type, #ver_inc
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #skip_count, #started_at, #status, #task_key, #task_manager, #type
Class Method Summary collapse
-
.default_retry_count ⇒ Object
重试配置:失败后重试 1 次.
-
.task_key ⇒ Object
任务键.
Instance Method Summary collapse
-
#initialize(project_path, options = {}) ⇒ GitCommitTask
constructor
初始化 Git 提交任务 版本号计算逻辑: 1.
- #validate ⇒ Object
Methods inherited from GitTask
default_retry_delay, default_retry_mode, #required_resources, task_type, task_type_name
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #data_param, 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, #release_resource, #release_resources, #required_resources, #reset_for_retry, #retryable?, #running?, #should_retry?, task_type, #with_resource, #with_resources
Constructor Details
#initialize(project_path, options = {}) ⇒ GitCommitTask
初始化 Git 提交任务版本号计算逻辑:
1.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/pindo/module/task/model/git/git_commit_task.rb', line 37 def initialize(project_path, = {}) # GitCommitTask 特有的属性 @fixed_version = [:fixed_version] # 外部指定的固定版本号 @process_type = [:process_type] || Pindo::UncommittedFilesProcessType::SKIP # 默认跳过 = [:commit_message] || 'build: 构建产生提交' # 默认提交消息 [:project_path] = project_path # 调用基类初始化(基类会设置 release_branch, ver_inc, tag_type, tag_pre 等通用属性) super("Git仓库文件提交检查", ) end |
Class Method Details
.default_retry_count ⇒ Object
重试配置:失败后重试 1 次
17 18 19 |
# File 'lib/pindo/module/task/model/git/git_commit_task.rb', line 17 def self.default_retry_count 2 end |
.task_key ⇒ Object
任务键
12 13 14 |
# File 'lib/pindo/module/task/model/git/git_commit_task.rb', line 12 def self.task_key :git_commit end |
Instance Method Details
#validate ⇒ Object
48 49 50 51 52 53 |
# File 'lib/pindo/module/task/model/git/git_commit_task.rb', line 48 def validate super # 不再验证是否为 Git 仓库,由 do_work 中处理 # 非 Git 仓库目录会跳过检查并成功返回 true end |