Class: Gct::Command::Skip::Tag

Inherits:
Gct::Command::Skip show all
Defined in:
lib/gct/command/skip/tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gct::Command

#auto_add_tag, #check_branch_can_be_update, #config_gitlab, #current_branch, #file_contents, #get_project, #gitlab_error, run

Constructor Details

#initialize(argv) ⇒ Tag

Returns a new instance of Tag.



23
24
25
26
27
28
# File 'lib/gct/command/skip/tag.rb', line 23

def initialize(argv)
  @project_version = argv.shift_argument
  @pod_name = argv.shift_argument
  @tag = argv.shift_argument
  super
end

Class Method Details

.optionsObject



20
21
# File 'lib/gct/command/skip/tag.rb', line 20

def self.options
end

Instance Method Details

#runObject



30
31
32
33
34
35
36
37
38
# File 'lib/gct/command/skip/tag.rb', line 30

def run
  db = Database::Data.new
  if !@tag.nil?
    tag_set = ", tag_version = '#{@tag}'"
  end
  update_code = "is_skip_tag = 1, tag_status = 'success'#{tag_set}"
  sql = "update tag set #{update_code} where pod_name = '#{@pod_name}' and project_version = '#{@project_version}'"
  res = db.query(sql)
end