Class: OfflineDeployer::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/offline_deployer/updater.rb

Constant Summary collapse

EXTRACT_DIRECTORY =
'tmp/releases/updater'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zip_file) ⇒ Updater

Returns a new instance of Updater.



3
4
5
# File 'lib/offline_deployer/updater.rb', line 3

def initialize(zip_file)
  @zip_file = zip_file
end

Instance Attribute Details

#zip_fileObject (readonly)

Returns the value of attribute zip_file.



7
8
9
# File 'lib/offline_deployer/updater.rb', line 7

def zip_file
  @zip_file
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/offline_deployer/updater.rb', line 11

def call
  validate_zip_file
  remove_old_update_files
  extract_new_version
  validate_version
  update_changed_files
  remove_deleted_files
  run_update_script
  finish_and_restart_server
end