Class: Kdep::Doctor::CheckStateTagFormat

Inherits:
Check
  • Object
show all
Defined in:
lib/kdep/doctor/check_state_tag_format.rb

Constant Summary collapse

ID =
"state_tag_format".freeze

Instance Attribute Summary

Attributes inherited from Check

#deploy_dir

Instance Method Summary collapse

Methods inherited from Check

#initialize

Constructor Details

This class inherits a constructor from Kdep::Doctor::Check

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/kdep/doctor/check_state_tag_format.rb', line 8

def run
  return Result.ok(ID) unless Kdep::State.exists?(deploy_dir)
  tag = Kdep::State.tag(deploy_dir)
  return Result.ok(ID) if Kdep::State.parseable_tag?(tag)
  Result.new(
    id: ID, severity: :warn,
    message: "state.yml tag #{tag.inspect} is not kdep's major.minor format",
    hint: "Next 'kdep bump' will fall back to 0.1 for this deploy."
  )
end