Travis Bundle Cache
The primary purpose of this gem is to make this easier and slightly more maintainable.
This gem loads, builds, and saves a cache of your bundled gems on S3 by ONLY modifying your project's .travis.yml file.
What you will need:
- A project on Travis CI
- An AWS account
- A "bundle install" that takes longer than "gem install nokogiri"
Usage
Set up a bucket on S3 in the US Standard region (us-east-1) (and possibly a new user via IAM)
Setup your .travis.yml to include the following (NOTE: this must be done before the next steps)
env: global: - BUNDLE_ARCHIVE="your-bundle-name" - AWS_S3_REGION="us-east-1" - AWS_S3_BUCKET="your-bucket-name" before_install: - 'echo ''gem: --no-ri --no-rdoc'' > ~/.gemrc' - gem install travis_bundle_cache install: travis_bundle_install after_script: - travis_bundle_cache
Install the travis gem (not the travis_bundle_cache gem)
gem install travis
Log into Travis (from inside your project respository directory)
travis login --auto
Encrypt your S3 credentials (be sure to add your actual credentials inside the double quotes)
travis encrypt AWS_S3_KEY="" AWS_S3_SECRET="" --add
Enjoy faster builds
Contributions
TravisBundleCache is open source and contributions from the community are encouraged! No contribution is too small. Please consider:
- adding an awesome feature
- fixing a terrible bug
- updating documentation
- fixing a not-so-bad bug
- fixing typos
For the best chance of having your changes merged, please:
- Ask us! We'd love to hear what you're up to.
- Fork the project.
- Commit your changes and tests (if applicable (they're applicable)).
- Submit a pull request with a thorough explanation and at least one animated GIF.
Thanks
Most of the credit for this gem goes to Random Errata and this blog post