Class: Pindo::TaskSystem::GitTagTask

Inherits:
PindoTask
  • Object
show all
Defined in:
lib/pindo/module/task/model/git_tag_task.rb

Overview

Git 标签任务检查并创建 Git 标签

Instance Attribute Summary collapse

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, #started_at, #status, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PindoTask

#before_retry, #cancel, #cancelled?, #check_cancelled!, #do_task, #execution_time, #finished?, #on, #reset_for_retry, #retryable?, #running?, #should_retry?

Constructor Details

#initialize(project_path, options = {}) ⇒ GitTagTask

初始化 Git 标签任务

Parameters:

  • project_path (String)

    项目路径

  • options (Hash) (defaults to: {})

    选项



31
32
33
34
35
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 31

def initialize(project_path, options = {})
  @project_path = project_path

  super("Git 标签检查", options)
end

Instance Attribute Details

#project_pathObject (readonly)

Returns the value of attribute project_path.



9
10
11
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 9

def project_path
  @project_path
end

Class Method Details

.default_retry_countObject



20
21
22
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 20

def self.default_retry_count
  0  # 可以重试 0 次
end

.default_retry_delayObject



24
25
26
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 24

def self.default_retry_delay
  5  # 默认延迟 5 秒
end

.default_retry_modeObject

重试配置



16
17
18
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 16

def self.default_retry_mode
  RetryMode::IMMEDIATE  # 立即重试
end

.task_typeObject



11
12
13
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 11

def self.task_type
  :git_tag
end

Instance Method Details

#validateObject



37
38
39
40
41
42
43
44
45
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 37

def validate
  # 验证项目路径是否存在
  unless @project_path && Dir.exist?(@project_path)
    @error = "项目路径不存在:#{@project_path}"
    return false
  end

  true
end