8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/packtory/tgz_package.rb', line 8
def self.build_package(opts = { })
packager = Packer.new({ :binstub => { } }.merge(opts))
fpm_exec = FpmExec.new(packager, INSTALL_PREFIX)
sfiles_map = packager.prepare_files(INSTALL_PREFIX)
package_filename = '%s_%s_%s.tar.gz' % [ packager.package_name, packager.version, packager.architecture ]
pkg_file_path = fpm_exec.build(sfiles_map, package_filename, type: :tgz)
if File.exist?(pkg_file_path)
Bundler.ui.info 'Created package: %s (%s bytes)' % [ pkg_file_path, File.size(pkg_file_path) ]
Bundler.ui.info 'SHA256 checksum: %s' % Digest::SHA256.file(pkg_file_path).hexdigest
else
Bundler.ui.error '[ERROR] Package not found: %s' % [ pkg_file_path ]
end
[ packager, pkg_file_path ]
end
|