Class: Bosh::Cli::SortedReleaseArchiver
- Defined in:
- lib/cli/sorted_release_archiver.rb
Instance Method Summary collapse
- #archive(destination_file) ⇒ Object
-
#initialize(dir) ⇒ SortedReleaseArchiver
constructor
A new instance of SortedReleaseArchiver.
Constructor Details
#initialize(dir) ⇒ SortedReleaseArchiver
Returns a new instance of SortedReleaseArchiver.
3 4 5 |
# File 'lib/cli/sorted_release_archiver.rb', line 3 def initialize(dir) @dir = dir end |
Instance Method Details
#archive(destination_file) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/cli/sorted_release_archiver.rb', line 7 def archive(destination_file) Dir.chdir(@dir) do ordered_release_files = Bosh::Common::Release::ReleaseDirectory.new('.').ordered_release_files success = Kernel.system('tar', '-C', @dir, '-pczf', destination_file, *ordered_release_files, out: '/dev/null', err: '/dev/null') if !success raise InvalidRelease, 'Cannot create release tarball' end end end |