Class: Kdep::Doctor::CheckStatePresent

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

Constant Summary collapse

ID =
"state_present".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
18
# File 'lib/kdep/doctor/check_state_present.rb', line 8

def run
  if Kdep::State.exists?(deploy_dir)
    Result.ok(ID)
  else
    Result.new(
      id: ID, severity: :warn,
      message: "state.yml missing in #{deploy_dir}",
      hint: "Run 'kdep bump --init-state' to seed, or commit a state.yml manually."
    )
  end
end