class Luban::Deployment::Application::Controller

Public Instance Methods

current?()
Alias for: current_configured?
current_configured?() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 7
def current_configured?; !!task.opts.release[:current]; end
Also aliased as: current?
current_release_tag() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 14
def current_release_tag
  if symlink?(current_app_path)
    File.basename(readlink(current_app_path))
  else
    nil
  end
end
current_symlinked?() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 10
def current_symlinked?
  release_tag == current_release_tag
end
deprecated?() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 23
def deprecated?; !!task.opts.release[:deprecated]; end
get_summary() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 25
def get_summary
  status = if current_symlinked?
             current? ? " *" : "s*"
           else
             current? ? "c*" : (deprecated? ? " d" : "  ")
           end

  if published?
    published = 'published'
    alert = case status
            when "s*"
              "Alert! #{application_name}:#{release_tag} is not the current version but symlinked IMPROPERLY. "
            when "c*"
              "Alert! #{application_name}:#{release_tag} is set as current version but NOT symlinked properly. "
            end
  else
    published = 'NOT published'
    alert = nil
  end
  update_result summary: { name: "#{application_name}:#{release_tag}", published: published,
                           status: status, alert: alert }
end
published?() click to toggle source
# File lib/luban/deployment/cli/application/controller.rb, line 22
def published?; directory?(release_path); end