Class: EY::Serverside::Source::Archive

Inherits:
EY::Serverside::Source show all
Defined in:
lib/engineyard-serverside/source/archive.rb

Overview

Deploy source for archive sourced deploy.

Instance Attribute Summary

Attributes inherited from EY::Serverside::Source

#opts, #ref, #shell, #source_cache, #uri

Instance Method Summary collapse

Methods inherited from EY::Serverside::Source

#initialize, require_opts

Constructor Details

This class inherits a constructor from EY::Serverside::Source

Instance Method Details

#create_revision_file_command(revision_file_path) ⇒ Object


7
8
9
# File 'lib/engineyard-serverside/source/archive.rb', line 7

def create_revision_file_command(revision_file_path)
  "echo #{escape(@checksum || filename)} > #{escape(revision_file_path.to_s)}"
end

#gc_repository_cacheObject


11
12
13
# File 'lib/engineyard-serverside/source/archive.rb', line 11

def gc_repository_cache
  # If files are uploaded to the server, we should clean them up here probably.
end

#same?(previous_rev, current_rev, paths = nil) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/engineyard-serverside/source/archive.rb', line 15

def same?(previous_rev, current_rev, paths=nil)
  previous_rev == current_rev
end

#short_log_message(rev) ⇒ Object


19
20
21
# File 'lib/engineyard-serverside/source/archive.rb', line 19

def short_log_message(rev)
  rev
end

#update_repository_cacheObject


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/engineyard-serverside/source/archive.rb', line 23

def update_repository_cache
  clean_cache
  in_source_cache do
    unless fetch && checksum
      shell.fatal "archive fetch from #{URI.parse(uri).hostname} failed."
      raise "archive fetch from #{URI.parse(uri).hostname} failed."
    end

    unless unarchive
      shell.fatal "unarchive of #{filename} failed."
      raise "unarchive of #{filename} failed."
    end
  end
end