Giter Site home page Giter Site logo

travis-homebrew-bottle's Introduction

Travis CI Homebrew custom bottle script

This script is to help with the scenario where you are compiling for OSX with Travis and you need to install software with Homebrew, but the default options in the brew's bottle won't work for you.

In this situation, you could compile the software from scratch, but this takes a long time on every push and wastes valuable Travis resources.

Instead, you can use this script to create a Homebrew Bottle (precompiled version) of the software you need, then you can simply install the bottle in your OSX build and there's no need to compile anything.

If you have a Mac you could do all this locally, but this script is for those without access to OSX. It uses Travis CI itself to compile the dependency once and upload it as a Github release, where it is easily available for other builds to use.

This script is currently set to brew and bottle boost with the --c++11 parameter, as the official boost bottle has been compiled without C++11 support.

Using this code

To make use of this script:

  1. Fork this repository on Github.

  2. In your Travis CI profile, use the button to resync to your Github account.

  3. Find the newly forked repo in the Travis CI list and enable it.

  4. Make a backup of .travis.yml.

  5. Run travis setup releases --force. Use your own Github credentials to generate a new OAuth token, so Travis can create Github releases for the repository.

  6. Put the new encrypted OAuth token into the .travis.yml backup.

  7. Overwrite .travis.yml with the updated backup and delete the backup.

  8. Update .travis.yml to compile the bottle you need.

  9. Commit the change and set a tag, e.g. git tag boost-1.60-cxx11

  10. Push the change to Github, making sure to push the tag also (git push origin master --tags).

  11. Watch Travis CI build the brew, bottle it, then upload it as a Github release.

Using the bottle

To use the bottle generated by this process, add the following to the .travis.yml for the project that needs to use the bottle.

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget 'https://github.com/<link-to-release>'; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install *.bottle.tar.gz; fi

travis-homebrew-bottle's People

Contributors

malvineous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.