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.
- AWS Credentials need to be configured to allow access to the S3 Bucket being written to.
gzs3 does not create a single file on disc, instead, the repo and file zip operation are all handled in memory.
- Your repo is cloned into memory
- A Zip file is then created (still memory)
- 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.zipThen 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.
If you have Golang installed:
go get github.com/daidokoro/gzs3
- Write some tests!!!
- Support for tar archive
- Add Binary and Install Script
Fork -> Patch -> Push -> Pull Request
Pull requests welcomed....
