Fast and simple uploading of static assets to Amazon S3
Slingshot is CLI tool for upload JS, CSS, PNG's and all the normal types of static assets to S3. This is usually used in conjunction with Akamai for serving to the public.
Slingshot can also list the static assets in a bucket if you need to know what is the latest version.
Slingshot will attempt to guess the MIME type of your files and set those automatically. Cache-Control is set to 1 year by default.
Options
-r region
-b bucket path
-p S3 folder path
Example
slingshot current -r eu-west-1 -b statics -p assets
assets/
assets/56/
assets/57/
Options
-r region
-b bucket path
-p S3 folder path
-d local directory
Example
slingshot upload -r eu-west-1 -b statics -p assets -d vendor
Uploading file:vendor/current.go
Uploading file:vendor/current_test.go
Uploading file:vendor/files/test.txt
Uploading file:vendor/upload.go
Uploading file:vendor/upload_test.go
Upload of directory vendor complete
This will upload assets resulting in the folling URL https://s3-eu-west-1.amazonaws.com/statics/assets/all.js
RPM is still WIP, this should be installed onto your Jenkins agents.
To install, use go get
:
$ go get -d github.com/DaveBlooman/slingshot
- Fork (https://github.com/DaveBlooman/slingshot/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create a new Pull Request