dennybaa
8/12/2011 - 12:24 PM

rollback hack

rollback hack

#
# rollback hack
#

class Chef::Provider::Deploy::Timestamped
  def action_rollback
    rollback_idx = all_releases.index(::File.readlink(@new_resource.current_path)) - 1
    if rollback_idx < 0
      Chef::Log.error("#{@new_resource} unable to rollback no past releases")
      return
    end
    @release_path = all_releases[rollback_idx]
    super
  end
end