Skip to content

daidokoro/gzs3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gzs3 - zip your Git Repo in S3

codebeat badge Go Report Card

asciicast

gzs3(Git Zip to S3) was born of a very specific need to automate the zipping and uploading of lambda functions to S3 from a Git Repository for Cloudformation Deployments.

gzs3 is capable of zipping any repo and storing it in s3, not just repos containing lambda functions.

Required

  • AWS Credentials need to be configured to allow access to the S3 Bucket being written to.

How it Works!

gzs3 does not create a single file on disc, instead, the repo and file zip operation are all handled in memory.

  1. Your repo is cloned into memory
  2. A Zip file is then created (still memory)
  3. The Zip file is written to s3

All you need to do is create a gzs3file in root of your repo, containing the following:

# bucket name
bucket: somebucket

# the name of the zip and key/prefix to stored it under in s3
key: some/key.zip

Then simply call the repo using the CLI tool.

Clone git Repo & ZIP to AWS S3...

Usage:
  gzs3 [flags]

Examples:
gzs3 git@github.com/some/repo.git

Flags:
      --debug             debug mode
  -h, --help              help for gzs3
      --no-colors         disable color output
      --password string   git password
  -p, --profile string    configured AWS profile (default "default")
  -i, --ssh-rsa string    path to git SSH id_rsa (default "/Users/shaunremekie/.ssh/id_rsa")
  -u, --user string       git username

Try:

$ gzs3 git@github.com:some/repo.git

Or via http(s)

$ gzs3 https://github.com/some/repo.git

Note: It's important to note that larger repos may consume a larger amount of memory to create a Zip file.

Installation

If you have Golang installed:

go get github.com/daidokoro/gzs3

TODO:

  • Write some tests!!!
  • Support for tar archive
  • Add Binary and Install Script

Contributing

Fork -> Patch -> Push -> Pull Request

Pull requests welcomed....

About

A simple tool for cloning git repos as ZIP files and storing them in s3

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages