Module: DTR::SyncCodebase::Package

Included in:
PackageTask, CopiablePackage, SyncService
Defined in:
lib/dtr/shared/sync_codebase/package.rb

Instance Method Summary collapse

Instance Method Details

#do_work(cmd) ⇒ Object



46
47
48
49
50
# File 'lib/dtr/shared/sync_codebase/package.rb', line 46

def do_work(cmd)
  unless Cmd.execute(cmd)
    raise "Execute command: #{cmd} failed. See log for details."
  end
end

#package_cmdObject



42
43
44
# File 'lib/dtr/shared/sync_codebase/package.rb', line 42

def package_cmd
  "zip -r #{package_file} #{package_name}"
end

#package_copy_fileObject



34
35
36
# File 'lib/dtr/shared/sync_codebase/package.rb', line 34

def package_copy_file
  "copy_#{package_file}"
end

#package_dirObject



18
19
20
# File 'lib/dtr/shared/sync_codebase/package.rb', line 18

def package_dir
  'dtr_pkg'
end

#package_dir_pathObject



26
27
28
# File 'lib/dtr/shared/sync_codebase/package.rb', line 26

def package_dir_path
  "#{package_dir}/#{package_name}"
end

#package_fileObject



30
31
32
# File 'lib/dtr/shared/sync_codebase/package.rb', line 30

def package_file
  "#{package_name}.zip"
end

#package_nameObject



22
23
24
# File 'lib/dtr/shared/sync_codebase/package.rb', line 22

def package_name
  'codebase-dump'
end

#unpackage_cmdObject



38
39
40
# File 'lib/dtr/shared/sync_codebase/package.rb', line 38

def unpackage_cmd
  "unzip #{package_copy_file}"
end