Class: Shipitron::Server::Git::UploadCache

Inherits:
Object
  • Object
show all
Includes:
Metaractor
Defined in:
lib/shipitron/server/git/upload_cache.rb

Instance Method Summary collapse

Instance Method Details

#callObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/shipitron/server/git/upload_cache.rb', line 15

def call
  Logger.info "Uploading git cache to bucket #{s3_cache_bucket}"
  create_tarball(filename: "/tmp/#{application}.git.tar.gz", directory: '/home/shipitron/git-cache')

  Pathname.new("/tmp/#{application}.git.tar.gz").open('rb') do |local_file|
    bucket.files.create(
      key: "#{application}.git.tar.gz",
      body: local_file.read
    )
  end
end